Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Change Log

## 12.2.0

* Added: Introduced `bigint` create/update APIs for legacy Databases attributes
* Added: Introduced `bigint` create/update APIs for `TablesDB` columns
* Updated: Extended key-list query filters with `key`, `resourceType`, `resourceId`, and `secret`

## 12.1.0

* Added: `setSession` method on `Client` for `X-Appwrite-Session` authentication
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Appwrite Console SDK

![License](https://img.shields.io/github/license/appwrite/sdk-for-console.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-1.9.3-blue.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-1.9.4-blue.svg?style=flat-square)
[![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator)
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite)
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord)

**This SDK is compatible with Appwrite server version 1.9.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-console/releases).**
**This SDK is compatible with Appwrite server version latest. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-console/releases).**

Appwrite is an open-source backend as a service server that abstracts and simplifies 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 Console 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)

Expand All @@ -33,7 +33,7 @@ import { Client, Account } from "@appwrite.io/console";
To install with a CDN (content delivery network) add the following scripts to the bottom of your <body> tag, but before you use any Appwrite services:

```html
<script src="https://cdn.jsdelivr.net/npm/@appwrite.io/console@12.1.0"></script>
<script src="https://cdn.jsdelivr.net/npm/@appwrite.io/console@12.2.0"></script>
```


Expand Down
22 changes: 22 additions & 0 deletions docs/examples/databases/create-big-int-attribute.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
```javascript
import { Client, Databases } 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 databases = new Databases(client);

const result = await databases.createBigIntAttribute({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '',
required: false,
min: null, // optional
max: null, // optional
default: null, // optional
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Wrong property name for default value in example

The example uses default: null but the TypeScript method signature expects the property to be named xdefault. Callers who copy this snippet verbatim will get a TypeScript type error (since default is not in the params interface) and the default value will be silently dropped from the request. The same mismatch exists in docs/examples/databases/update-big-int-attribute.md, docs/examples/tablesdb/create-big-int-column.md, and docs/examples/tablesdb/update-big-int-column.md.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is also present in the main repo as well https://github.com/appwrite/sdk-for-console/blob/main/docs/examples/tablesdb/create-integer-column.md
default and not xdefault

array: false // optional
});

console.log(result);
```
22 changes: 22 additions & 0 deletions docs/examples/databases/update-big-int-attribute.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
```javascript
import { Client, Databases } 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 databases = new Databases(client);

const result = await databases.updateBigIntAttribute({
databaseId: '<DATABASE_ID>',
collectionId: '<COLLECTION_ID>',
key: '',
required: false,
default: null,
min: null, // optional
max: null, // optional
newKey: '' // optional
});

console.log(result);
```
1 change: 1 addition & 0 deletions docs/examples/functions/create-variable.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const functions = new Functions(client);

const result = await functions.createVariable({
functionId: '<FUNCTION_ID>',
variableId: '<VARIABLE_ID>',
key: '<KEY>',
value: '<VALUE>',
secret: false // optional
Expand Down
4 changes: 3 additions & 1 deletion docs/examples/functions/list-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ const client = new Client()
const functions = new Functions(client);

const result = await functions.listVariables({
functionId: '<FUNCTION_ID>'
functionId: '<FUNCTION_ID>',
queries: [], // optional
total: false // optional
});

console.log(result);
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/functions/update-variable.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const functions = new Functions(client);
const result = await functions.updateVariable({
functionId: '<FUNCTION_ID>',
variableId: '<VARIABLE_ID>',
key: '<KEY>',
key: '<KEY>', // optional
value: '<VALUE>', // optional
secret: false // optional
});
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/project/create-ephemeral-key.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const project = new Project(client);

const result = await project.createEphemeralKey({
scopes: [Scopes.ProjectRead],
duration: 1
duration: 600
});

console.log(result);
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/project/get-o-auth-2-provider.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
```javascript
import { Client, Project } from "@appwrite.io/console";
import { Client, Project, ProviderId } from "@appwrite.io/console";

const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
Expand All @@ -8,7 +8,7 @@ const client = new Client()
const project = new Project(client);

const result = await project.getOAuth2Provider({
provider: '<PROVIDER>'
providerId: ProviderId.Amazon
});

console.log(result);
Expand Down
5 changes: 4 additions & 1 deletion docs/examples/project/list-o-auth-2-providers.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ const client = new Client()

const project = new Project(client);

const result = await project.listOAuth2Providers();
const result = await project.listOAuth2Providers({
queries: [], // optional
total: false // optional
});

console.log(result);
```
4 changes: 2 additions & 2 deletions docs/examples/project/update-o-auth-2-oidc.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ const result = await project.updateOAuth2Oidc({
clientSecret: '<CLIENT_SECRET>', // optional
wellKnownURL: 'https://example.com', // optional
authorizationURL: 'https://example.com', // optional
tokenUrl: 'https://example.com', // optional
userInfoUrl: 'https://example.com', // optional
tokenURL: 'https://example.com', // optional
userInfoURL: 'https://example.com', // optional
enabled: false // optional
});

Expand Down
1 change: 0 additions & 1 deletion docs/examples/proxy/list-rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ const proxy = new Proxy(client);

const result = await proxy.listRules({
queries: [], // optional
search: '<SEARCH>', // optional
total: false // optional
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const client = new Client()

const proxy = new Proxy(client);

const result = await proxy.updateRuleVerification({
const result = await proxy.updateRuleStatus({
ruleId: '<RULE_ID>'
});

Expand Down
1 change: 1 addition & 0 deletions docs/examples/sites/create-variable.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const sites = new Sites(client);

const result = await sites.createVariable({
siteId: '<SITE_ID>',
variableId: '<VARIABLE_ID>',
key: '<KEY>',
value: '<VALUE>',
secret: false // optional
Expand Down
4 changes: 3 additions & 1 deletion docs/examples/sites/list-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ const client = new Client()
const sites = new Sites(client);

const result = await sites.listVariables({
siteId: '<SITE_ID>'
siteId: '<SITE_ID>',
queries: [], // optional
total: false // optional
});

console.log(result);
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/sites/update-variable.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const sites = new Sites(client);
const result = await sites.updateVariable({
siteId: '<SITE_ID>',
variableId: '<VARIABLE_ID>',
key: '<KEY>',
key: '<KEY>', // optional
value: '<VALUE>', // optional
secret: false // optional
});
Expand Down
22 changes: 22 additions & 0 deletions docs/examples/tablesdb/create-big-int-column.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
```javascript
import { Client, TablesDB } 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 tablesDB = new TablesDB(client);

const result = await tablesDB.createBigIntColumn({
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
key: '',
required: false,
min: null, // optional
max: null, // optional
default: null, // optional
array: false // optional
});

console.log(result);
```
22 changes: 22 additions & 0 deletions docs/examples/tablesdb/update-big-int-column.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
```javascript
import { Client, TablesDB } 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 tablesDB = new TablesDB(client);

const result = await tablesDB.updateBigIntColumn({
databaseId: '<DATABASE_ID>',
tableId: '<TABLE_ID>',
key: '',
required: false,
default: null,
min: null, // optional
max: null, // optional
newKey: '' // optional
});

console.log(result);
```
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@appwrite.io/console",
"homepage": "https://appwrite.io/support",
"description": "Appwrite is an open-source self-hosted backend server that abstracts and simplifies complex and repetitive development tasks behind a very simple REST API",
"version": "12.1.0",
"version": "12.2.0",
"license": "BSD-3-Clause",
"main": "dist/cjs/sdk.js",
"exports": {
Expand Down
4 changes: 2 additions & 2 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -390,8 +390,8 @@ class Client {
'x-sdk-name': 'Console',
'x-sdk-platform': 'console',
'x-sdk-language': 'web',
Comment thread
greptile-apps[bot] marked this conversation as resolved.
'x-sdk-version': '12.1.0',
'X-Appwrite-Response-Format': '1.9.3',
'x-sdk-version': '12.2.0',
'X-Appwrite-Response-Format': '1.9.4',
};

/**
Expand Down
49 changes: 49 additions & 0 deletions src/enums/provider-id.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
export enum ProviderId {
Amazon = 'amazon',
Apple = 'apple',
Auth0 = 'auth0',
Authentik = 'authentik',
Autodesk = 'autodesk',
Bitbucket = 'bitbucket',
Bitly = 'bitly',
Box = 'box',
Dailymotion = 'dailymotion',
Discord = 'discord',
Disqus = 'disqus',
Dropbox = 'dropbox',
Etsy = 'etsy',
Facebook = 'facebook',
Figma = 'figma',
Fusionauth = 'fusionauth',
Github = 'github',
Gitlab = 'gitlab',
Google = 'google',
Keycloak = 'keycloak',
Kick = 'kick',
Linkedin = 'linkedin',
Microsoft = 'microsoft',
Notion = 'notion',
Oidc = 'oidc',
Okta = 'okta',
Paypal = 'paypal',
PaypalSandbox = 'paypalSandbox',
Podio = 'podio',
Salesforce = 'salesforce',
Slack = 'slack',
Spotify = 'spotify',
Stripe = 'stripe',
Tradeshift = 'tradeshift',
TradeshiftBox = 'tradeshiftBox',
Twitch = 'twitch',
Wordpress = 'wordpress',
X = 'x',
Yahoo = 'yahoo',
Yammer = 'yammer',
Yandex = 'yandex',
Zoho = 'zoho',
Zoom = 'zoom',
Mock = 'mock',
Mockunverified = 'mock-unverified',
GithubImagine = 'githubImagine',
GoogleImagine = 'googleImagine',
}
3 changes: 1 addition & 2 deletions src/enums/proxy-rule-status.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
export enum ProxyRuleStatus {
Created = 'created',
Unverified = 'unverified',
Verifying = 'verifying',
Verified = 'verified',
Unverified = 'unverified',
}
4 changes: 2 additions & 2 deletions src/enums/scopes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ export enum Scopes {
TargetsWrite = 'targets.write',
MessagesRead = 'messages.read',
MessagesWrite = 'messages.write',
RulesRead = 'rules.read',
RulesWrite = 'rules.write',
WebhooksRead = 'webhooks.read',
WebhooksWrite = 'webhooks.write',
LocaleRead = 'locale.read',
Expand All @@ -76,8 +78,6 @@ export enum Scopes {
SchedulesWrite = 'schedules.write',
VcsRead = 'vcs.read',
VcsWrite = 'vcs.write',
RulesRead = 'rules.read',
RulesWrite = 'rules.write',
BackupsPoliciesRead = 'backups.policies.read',
BackupsPoliciesWrite = 'backups.policies.write',
ArchivesRead = 'archives.read',
Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ export { NHostMigrationResource } from './enums/n-host-migration-resource';
export { SupabaseMigrationResource } from './enums/supabase-migration-resource';
export { Addon } from './enums/addon';
export { MethodId } from './enums/method-id';
export { ProviderId } from './enums/provider-id';
export { PolicyId } from './enums/policy-id';
export { ProtocolId } from './enums/protocol-id';
export { ServiceId } from './enums/service-id';
Expand Down
Loading
Loading