chore: update specs and examples

This commit is contained in:
Chirag Aggarwal
2025-05-16 09:32:05 +00:00
parent d2d126e89b
commit 88f1fa6c67
200 changed files with 718 additions and 1987 deletions
@@ -13,7 +13,7 @@ avatars.getBrowser(
Browser.AVANT_BROWSER, // code
0, // width (optional)
0, // height (optional)
0, // quality (optional)
-1, // quality (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
@@ -13,7 +13,7 @@ avatars.getCreditCard(
CreditCard.AMERICAN_EXPRESS, // code
0, // width (optional)
0, // height (optional)
0, // quality (optional)
-1, // quality (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
@@ -13,7 +13,7 @@ avatars.getFlag(
Flag.AFGHANISTAN, // code
0, // width (optional)
0, // height (optional)
0, // quality (optional)
-1, // quality (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
@@ -11,6 +11,7 @@ Storage storage = new Storage(client);
storage.getFileDownload(
"<BUCKET_ID>", // bucketId
"<FILE_ID>", // fileId
"<TOKEN>", // token (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
@@ -14,7 +14,7 @@ storage.getFilePreview(
0, // width (optional)
0, // height (optional)
ImageGravity.CENTER, // gravity (optional)
0, // quality (optional)
-1, // quality (optional)
0, // borderWidth (optional)
"", // borderColor (optional)
0, // borderRadius (optional)
@@ -22,6 +22,7 @@ storage.getFilePreview(
-360, // rotation (optional)
"", // background (optional)
ImageFormat.JPG, // output (optional)
"<TOKEN>", // token (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
@@ -11,6 +11,7 @@ Storage storage = new Storage(client);
storage.getFileView(
"<BUCKET_ID>", // bucketId
"<FILE_ID>", // fileId
"<TOKEN>", // token (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
@@ -13,5 +13,5 @@ val result = avatars.getBrowser(
code = Browser.AVANT_BROWSER,
width = 0, // (optional)
height = 0, // (optional)
quality = 0, // (optional)
quality = -1, // (optional)
)
@@ -13,5 +13,5 @@ val result = avatars.getCreditCard(
code = CreditCard.AMERICAN_EXPRESS,
width = 0, // (optional)
height = 0, // (optional)
quality = 0, // (optional)
quality = -1, // (optional)
)
@@ -13,5 +13,5 @@ val result = avatars.getFlag(
code = Flag.AFGHANISTAN,
width = 0, // (optional)
height = 0, // (optional)
quality = 0, // (optional)
quality = -1, // (optional)
)
@@ -11,4 +11,5 @@ val storage = Storage(client)
val result = storage.getFileDownload(
bucketId = "<BUCKET_ID>",
fileId = "<FILE_ID>",
token = "<TOKEN>", // (optional)
)
@@ -14,7 +14,7 @@ val result = storage.getFilePreview(
width = 0, // (optional)
height = 0, // (optional)
gravity = ImageGravity.CENTER, // (optional)
quality = 0, // (optional)
quality = -1, // (optional)
borderWidth = 0, // (optional)
borderColor = "", // (optional)
borderRadius = 0, // (optional)
@@ -22,4 +22,5 @@ val result = storage.getFilePreview(
rotation = -360, // (optional)
background = "", // (optional)
output = ImageFormat.JPG, // (optional)
token = "<TOKEN>", // (optional)
)
@@ -11,4 +11,5 @@ val storage = Storage(client)
val result = storage.getFileView(
bucketId = "<BUCKET_ID>",
fileId = "<FILE_ID>",
token = "<TOKEN>", // (optional)
)
@@ -11,6 +11,6 @@ let bytes = try await avatars.getBrowser(
code: .avantBrowser,
width: 0, // optional
height: 0, // optional
quality: 0 // optional
quality: -1 // optional
)
@@ -11,6 +11,6 @@ let bytes = try await avatars.getCreditCard(
code: .americanExpress,
width: 0, // optional
height: 0, // optional
quality: 0 // optional
quality: -1 // optional
)
@@ -11,6 +11,6 @@ let bytes = try await avatars.getFlag(
code: .afghanistan,
width: 0, // optional
height: 0, // optional
quality: 0 // optional
quality: -1 // optional
)
@@ -8,6 +8,7 @@ let storage = Storage(client)
let bytes = try await storage.getFileDownload(
bucketId: "<BUCKET_ID>",
fileId: "<FILE_ID>"
fileId: "<FILE_ID>",
token: "<TOKEN>" // optional
)
@@ -13,13 +13,14 @@ let bytes = try await storage.getFilePreview(
width: 0, // optional
height: 0, // optional
gravity: .center, // optional
quality: 0, // optional
quality: -1, // optional
borderWidth: 0, // optional
borderColor: "", // optional
borderRadius: 0, // optional
opacity: 0, // optional
rotation: -360, // optional
background: "", // optional
output: .jpg // optional
output: .jpg, // optional
token: "<TOKEN>" // optional
)
@@ -8,6 +8,7 @@ let storage = Storage(client)
let bytes = try await storage.getFileView(
bucketId: "<BUCKET_ID>",
fileId: "<FILE_ID>"
fileId: "<FILE_ID>",
token: "<TOKEN>" // optional
)
@@ -11,7 +11,7 @@ UInt8List bytes = await avatars.getBrowser(
code: Browser.avantBrowser,
width: 0, // optional
height: 0, // optional
quality: 0, // optional
quality: -1, // optional
)
final file = File('path_to_file/filename.ext');
@@ -23,7 +23,7 @@ FutureBuilder(
code: Browser.avantBrowser,
width:0 , // optional
height:0 , // optional
quality:0 , // optional
quality:-1 , // optional
), // Works for both public file and private file, for private files you need to be logged in
builder: (context, snapshot) {
return snapshot.hasData && snapshot.data != null
@@ -11,7 +11,7 @@ UInt8List bytes = await avatars.getCreditCard(
code: CreditCard.americanExpress,
width: 0, // optional
height: 0, // optional
quality: 0, // optional
quality: -1, // optional
)
final file = File('path_to_file/filename.ext');
@@ -23,7 +23,7 @@ FutureBuilder(
code: CreditCard.americanExpress,
width:0 , // optional
height:0 , // optional
quality:0 , // optional
quality:-1 , // optional
), // Works for both public file and private file, for private files you need to be logged in
builder: (context, snapshot) {
return snapshot.hasData && snapshot.data != null
@@ -11,7 +11,7 @@ UInt8List bytes = await avatars.getFlag(
code: Flag.afghanistan,
width: 0, // optional
height: 0, // optional
quality: 0, // optional
quality: -1, // optional
)
final file = File('path_to_file/filename.ext');
@@ -23,7 +23,7 @@ FutureBuilder(
code: Flag.afghanistan,
width:0 , // optional
height:0 , // optional
quality:0 , // optional
quality:-1 , // optional
), // Works for both public file and private file, for private files you need to be logged in
builder: (context, snapshot) {
return snapshot.hasData && snapshot.data != null
@@ -10,6 +10,7 @@ Storage storage = Storage(client);
UInt8List bytes = await storage.getFileDownload(
bucketId: '<BUCKET_ID>',
fileId: '<FILE_ID>',
token: '<TOKEN>', // optional
)
final file = File('path_to_file/filename.ext');
@@ -20,6 +21,7 @@ FutureBuilder(
future: storage.getFileDownload(
bucketId:'<BUCKET_ID>' ,
fileId:'<FILE_ID>' ,
token:'<TOKEN>' , // optional
), // Works for both public file and private file, for private files you need to be logged in
builder: (context, snapshot) {
return snapshot.hasData && snapshot.data != null
@@ -13,7 +13,7 @@ UInt8List bytes = await storage.getFilePreview(
width: 0, // optional
height: 0, // optional
gravity: ImageGravity.center, // optional
quality: 0, // optional
quality: -1, // optional
borderWidth: 0, // optional
borderColor: '', // optional
borderRadius: 0, // optional
@@ -21,6 +21,7 @@ UInt8List bytes = await storage.getFilePreview(
rotation: -360, // optional
background: '', // optional
output: ImageFormat.jpg, // optional
token: '<TOKEN>', // optional
)
final file = File('path_to_file/filename.ext');
@@ -34,7 +35,7 @@ FutureBuilder(
width:0 , // optional
height:0 , // optional
gravity: ImageGravity.center, // optional
quality:0 , // optional
quality:-1 , // optional
borderWidth:0 , // optional
borderColor:'' , // optional
borderRadius:0 , // optional
@@ -42,6 +43,7 @@ FutureBuilder(
rotation:-360 , // optional
background:'' , // optional
output: ImageFormat.jpg, // optional
token:'<TOKEN>' , // optional
), // Works for both public file and private file, for private files you need to be logged in
builder: (context, snapshot) {
return snapshot.hasData && snapshot.data != null
@@ -10,6 +10,7 @@ Storage storage = Storage(client);
UInt8List bytes = await storage.getFileView(
bucketId: '<BUCKET_ID>',
fileId: '<FILE_ID>',
token: '<TOKEN>', // optional
)
final file = File('path_to_file/filename.ext');
@@ -20,6 +21,7 @@ FutureBuilder(
future: storage.getFileView(
bucketId:'<BUCKET_ID>' ,
fileId:'<FILE_ID>' ,
token:'<TOKEN>' , // optional
), // Works for both public file and private file, for private files you need to be logged in
builder: (context, snapshot) {
return snapshot.hasData && snapshot.data != null
@@ -10,7 +10,7 @@ const result = avatars.getBrowser(
Browser.AvantBrowser, // code
0, // width (optional)
0, // height (optional)
0 // quality (optional)
-1 // quality (optional)
);
console.log(result);
@@ -10,7 +10,7 @@ const result = avatars.getCreditCard(
CreditCard.AmericanExpress, // code
0, // width (optional)
0, // height (optional)
0 // quality (optional)
-1 // quality (optional)
);
console.log(result);
@@ -10,7 +10,7 @@ const result = avatars.getFlag(
Flag.Afghanistan, // code
0, // width (optional)
0, // height (optional)
0 // quality (optional)
-1 // quality (optional)
);
console.log(result);
@@ -8,7 +8,8 @@ const storage = new Storage(client);
const result = storage.getFileDownload(
'<BUCKET_ID>', // bucketId
'<FILE_ID>' // fileId
'<FILE_ID>', // fileId
'<TOKEN>' // token (optional)
);
console.log(result);
@@ -12,14 +12,15 @@ const result = storage.getFilePreview(
0, // width (optional)
0, // height (optional)
ImageGravity.Center, // gravity (optional)
0, // quality (optional)
-1, // quality (optional)
0, // borderWidth (optional)
'', // borderColor (optional)
0, // borderRadius (optional)
0, // opacity (optional)
-360, // rotation (optional)
'', // background (optional)
ImageFormat.Jpg // output (optional)
ImageFormat.Jpg, // output (optional)
'<TOKEN>' // token (optional)
);
console.log(result);
@@ -8,7 +8,8 @@ const storage = new Storage(client);
const result = storage.getFileView(
'<BUCKET_ID>', // bucketId
'<FILE_ID>' // fileId
'<FILE_ID>', // fileId
'<TOKEN>' // token (optional)
);
console.log(result);
@@ -10,7 +10,7 @@ const result = avatars.getBrowser(
Browser.AvantBrowser, // code
0, // width (optional)
0, // height (optional)
0 // quality (optional)
-1 // quality (optional)
);
console.log(result);
@@ -10,7 +10,7 @@ const result = avatars.getCreditCard(
CreditCard.AmericanExpress, // code
0, // width (optional)
0, // height (optional)
0 // quality (optional)
-1 // quality (optional)
);
console.log(result);
@@ -10,7 +10,7 @@ const result = avatars.getFlag(
Flag.Afghanistan, // code
0, // width (optional)
0, // height (optional)
0 // quality (optional)
-1 // quality (optional)
);
console.log(result);
@@ -8,7 +8,8 @@ const storage = new Storage(client);
const result = storage.getFileDownload(
'<BUCKET_ID>', // bucketId
'<FILE_ID>' // fileId
'<FILE_ID>', // fileId
'<TOKEN>' // token (optional)
);
console.log(result);
@@ -12,14 +12,15 @@ const result = storage.getFilePreview(
0, // width (optional)
0, // height (optional)
ImageGravity.Center, // gravity (optional)
0, // quality (optional)
-1, // quality (optional)
0, // borderWidth (optional)
'', // borderColor (optional)
0, // borderRadius (optional)
0, // opacity (optional)
-360, // rotation (optional)
'', // background (optional)
ImageFormat.Jpg // output (optional)
ImageFormat.Jpg, // output (optional)
'<TOKEN>' // token (optional)
);
console.log(result);
@@ -8,7 +8,8 @@ const storage = new Storage(client);
const result = storage.getFileView(
'<BUCKET_ID>', // bucketId
'<FILE_ID>' // fileId
'<FILE_ID>', // fileId
'<TOKEN>' // token (optional)
);
console.log(result);
@@ -5,3 +5,4 @@ appwrite databases createIndex \
--type key \
--attributes one two three \
@@ -1,3 +1,4 @@
appwrite storage getFileDownload \
--bucketId <BUCKET_ID> \
--fileId <FILE_ID>
--fileId <FILE_ID> \
@@ -12,3 +12,4 @@ appwrite storage getFilePreview \
@@ -1,3 +1,4 @@
appwrite storage getFileView \
--bucketId <BUCKET_ID> \
--fileId <FILE_ID>
--fileId <FILE_ID> \
@@ -2,4 +2,3 @@ appwrite tokens createFileToken \
--bucketId <BUCKET_ID> \
--fileId <FILE_ID> \
@@ -1,4 +1,3 @@
appwrite tokens update \
--tokenId <TOKEN_ID> \
@@ -10,7 +10,7 @@ const result = avatars.getBrowser(
Browser.AvantBrowser, // code
0, // width (optional)
0, // height (optional)
0 // quality (optional)
-1 // quality (optional)
);
console.log(result);
@@ -10,7 +10,7 @@ const result = avatars.getCreditCard(
CreditCard.AmericanExpress, // code
0, // width (optional)
0, // height (optional)
0 // quality (optional)
-1 // quality (optional)
);
console.log(result);
@@ -10,7 +10,7 @@ const result = avatars.getFlag(
Flag.Afghanistan, // code
0, // width (optional)
0, // height (optional)
0 // quality (optional)
-1 // quality (optional)
);
console.log(result);
@@ -12,7 +12,8 @@ const result = await databases.createIndex(
'', // key
IndexType.Key, // type
[], // attributes
[] // orders (optional)
[], // orders (optional)
[] // lengths (optional)
);
console.log(result);
@@ -8,7 +8,8 @@ const storage = new Storage(client);
const result = storage.getFileDownload(
'<BUCKET_ID>', // bucketId
'<FILE_ID>' // fileId
'<FILE_ID>', // fileId
'<TOKEN>' // token (optional)
);
console.log(result);
@@ -12,14 +12,15 @@ const result = storage.getFilePreview(
0, // width (optional)
0, // height (optional)
ImageGravity.Center, // gravity (optional)
0, // quality (optional)
-1, // quality (optional)
0, // borderWidth (optional)
'', // borderColor (optional)
0, // borderRadius (optional)
0, // opacity (optional)
-360, // rotation (optional)
'', // background (optional)
ImageFormat.Jpg // output (optional)
ImageFormat.Jpg, // output (optional)
'<TOKEN>' // token (optional)
);
console.log(result);
@@ -8,7 +8,8 @@ const storage = new Storage(client);
const result = storage.getFileView(
'<BUCKET_ID>', // bucketId
'<FILE_ID>' // fileId
'<FILE_ID>', // fileId
'<TOKEN>' // token (optional)
);
console.log(result);
@@ -9,8 +9,7 @@ const tokens = new Tokens(client);
const result = await tokens.createFileToken(
'<BUCKET_ID>', // bucketId
'<FILE_ID>', // fileId
'', // expire (optional)
["read("any")"] // permissions (optional)
'' // expire (optional)
);
console.log(result);
@@ -8,8 +8,7 @@ const tokens = new Tokens(client);
const result = await tokens.update(
'<TOKEN_ID>', // tokenId
'', // expire (optional)
["read("any")"] // permissions (optional)
'' // expire (optional)
);
console.log(result);
@@ -11,5 +11,5 @@ UInt8List result = await avatars.getBrowser(
code: Browser.avantBrowser,
width: 0, // (optional)
height: 0, // (optional)
quality: 0, // (optional)
quality: -1, // (optional)
);
@@ -11,5 +11,5 @@ UInt8List result = await avatars.getCreditCard(
code: CreditCard.americanExpress,
width: 0, // (optional)
height: 0, // (optional)
quality: 0, // (optional)
quality: -1, // (optional)
);
@@ -11,5 +11,5 @@ UInt8List result = await avatars.getFlag(
code: Flag.afghanistan,
width: 0, // (optional)
height: 0, // (optional)
quality: 0, // (optional)
quality: -1, // (optional)
);
@@ -14,4 +14,5 @@ Index result = await databases.createIndex(
type: IndexType.key,
attributes: [],
orders: [], // (optional)
lengths: [], // (optional)
);
@@ -10,4 +10,5 @@ Storage storage = Storage(client);
UInt8List result = await storage.getFileDownload(
bucketId: '<BUCKET_ID>',
fileId: '<FILE_ID>',
token: '<TOKEN>', // (optional)
);
@@ -13,7 +13,7 @@ UInt8List result = await storage.getFilePreview(
width: 0, // (optional)
height: 0, // (optional)
gravity: ImageGravity.center, // (optional)
quality: 0, // (optional)
quality: -1, // (optional)
borderWidth: 0, // (optional)
borderColor: '', // (optional)
borderRadius: 0, // (optional)
@@ -21,4 +21,5 @@ UInt8List result = await storage.getFilePreview(
rotation: -360, // (optional)
background: '', // (optional)
output: ImageFormat.jpg, // (optional)
token: '<TOKEN>', // (optional)
);
@@ -10,4 +10,5 @@ Storage storage = Storage(client);
UInt8List result = await storage.getFileView(
bucketId: '<BUCKET_ID>',
fileId: '<FILE_ID>',
token: '<TOKEN>', // (optional)
);
@@ -3,7 +3,7 @@ import 'package:dart_appwrite/dart_appwrite.dart';
Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setSession(''); // The user session to authenticate with
.setKey('<YOUR_API_KEY>'); // Your secret API key
Tokens tokens = Tokens(client);
@@ -11,5 +11,4 @@ ResourceToken result = await tokens.createFileToken(
bucketId: '<BUCKET_ID>',
fileId: '<FILE_ID>',
expire: '', // (optional)
permissions: ["read("any")"], // (optional)
);
@@ -3,7 +3,7 @@ import 'package:dart_appwrite/dart_appwrite.dart';
Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setSession(''); // The user session to authenticate with
.setKey('<YOUR_API_KEY>'); // Your secret API key
Tokens tokens = Tokens(client);
@@ -3,7 +3,7 @@ import 'package:dart_appwrite/dart_appwrite.dart';
Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setSession(''); // The user session to authenticate with
.setKey('<YOUR_API_KEY>'); // Your secret API key
Tokens tokens = Tokens(client);
@@ -3,7 +3,7 @@ import 'package:dart_appwrite/dart_appwrite.dart';
Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setSession(''); // The user session to authenticate with
.setKey('<YOUR_API_KEY>'); // Your secret API key
Tokens tokens = Tokens(client);
@@ -3,12 +3,11 @@ import 'package:dart_appwrite/dart_appwrite.dart';
Client client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setSession(''); // The user session to authenticate with
.setKey('<YOUR_API_KEY>'); // Your secret API key
Tokens tokens = Tokens(client);
ResourceToken result = await tokens.update(
tokenId: '<TOKEN_ID>',
expire: '', // (optional)
permissions: ["read("any")"], // (optional)
);
@@ -11,5 +11,5 @@ const result = avatars.getBrowser(
Browser.AvantBrowser, // code
0, // width (optional)
0, // height (optional)
0 // quality (optional)
-1 // quality (optional)
);
@@ -11,5 +11,5 @@ const result = avatars.getCreditCard(
CreditCard.AmericanExpress, // code
0, // width (optional)
0, // height (optional)
0 // quality (optional)
-1 // quality (optional)
);
@@ -11,5 +11,5 @@ const result = avatars.getFlag(
Flag.Afghanistan, // code
0, // width (optional)
0, // height (optional)
0 // quality (optional)
-1 // quality (optional)
);
@@ -13,5 +13,6 @@ const response = await databases.createIndex(
'', // key
IndexType.Key, // type
[], // attributes
[] // orders (optional)
[], // orders (optional)
[] // lengths (optional)
);
@@ -9,5 +9,6 @@ const storage = new Storage(client);
const result = storage.getFileDownload(
'<BUCKET_ID>', // bucketId
'<FILE_ID>' // fileId
'<FILE_ID>', // fileId
'<TOKEN>' // token (optional)
);
@@ -13,12 +13,13 @@ const result = storage.getFilePreview(
0, // width (optional)
0, // height (optional)
ImageGravity.Center, // gravity (optional)
0, // quality (optional)
-1, // quality (optional)
0, // borderWidth (optional)
'', // borderColor (optional)
0, // borderRadius (optional)
0, // opacity (optional)
-360, // rotation (optional)
'', // background (optional)
ImageFormat.Jpg // output (optional)
ImageFormat.Jpg, // output (optional)
'<TOKEN>' // token (optional)
);
@@ -9,5 +9,6 @@ const storage = new Storage(client);
const result = storage.getFileView(
'<BUCKET_ID>', // bucketId
'<FILE_ID>' // fileId
'<FILE_ID>', // fileId
'<TOKEN>' // token (optional)
);
@@ -3,13 +3,12 @@ import { Client, Tokens } from "https://deno.land/x/appwrite/mod.ts";
const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setSession(''); // The user session to authenticate with
.setKey('<YOUR_API_KEY>'); // Your secret API key
const tokens = new Tokens(client);
const response = await tokens.createFileToken(
'<BUCKET_ID>', // bucketId
'<FILE_ID>', // fileId
'', // expire (optional)
["read("any")"] // permissions (optional)
'' // expire (optional)
);
@@ -3,7 +3,7 @@ import { Client, Tokens } from "https://deno.land/x/appwrite/mod.ts";
const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setSession(''); // The user session to authenticate with
.setKey('<YOUR_API_KEY>'); // Your secret API key
const tokens = new Tokens(client);
@@ -3,7 +3,7 @@ import { Client, Tokens } from "https://deno.land/x/appwrite/mod.ts";
const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setSession(''); // The user session to authenticate with
.setKey('<YOUR_API_KEY>'); // Your secret API key
const tokens = new Tokens(client);
@@ -3,7 +3,7 @@ import { Client, Tokens } from "https://deno.land/x/appwrite/mod.ts";
const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setSession(''); // The user session to authenticate with
.setKey('<YOUR_API_KEY>'); // Your secret API key
const tokens = new Tokens(client);
@@ -3,12 +3,11 @@ import { Client, Tokens } from "https://deno.land/x/appwrite/mod.ts";
const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1') // Your API Endpoint
.setProject('<YOUR_PROJECT_ID>') // Your project ID
.setSession(''); // The user session to authenticate with
.setKey('<YOUR_API_KEY>'); // Your secret API key
const tokens = new Tokens(client);
const response = await tokens.update(
'<TOKEN_ID>', // tokenId
'', // expire (optional)
["read("any")"] // permissions (optional)
'' // expire (optional)
);
@@ -14,5 +14,5 @@ byte[] result = await avatars.GetBrowser(
code: Browser.AvantBrowser,
width: 0, // optional
height: 0, // optional
quality: 0 // optional
quality: -1 // optional
);
@@ -14,5 +14,5 @@ byte[] result = await avatars.GetCreditCard(
code: CreditCard.AmericanExpress,
width: 0, // optional
height: 0, // optional
quality: 0 // optional
quality: -1 // optional
);
@@ -14,5 +14,5 @@ byte[] result = await avatars.GetFlag(
code: Flag.Afghanistan,
width: 0, // optional
height: 0, // optional
quality: 0 // optional
quality: -1 // optional
);
@@ -16,5 +16,6 @@ Index result = await databases.CreateIndex(
key: "",
type: IndexType.Key,
attributes: new List<string>(),
orders: new List<string>() // optional
orders: new List<string>(), // optional
lengths: new List<long>() // optional
);
@@ -11,5 +11,6 @@ Storage storage = new Storage(client);
byte[] result = await storage.GetFileDownload(
bucketId: "<BUCKET_ID>",
fileId: "<FILE_ID>"
fileId: "<FILE_ID>",
token: "<TOKEN>" // optional
);
@@ -16,12 +16,13 @@ byte[] result = await storage.GetFilePreview(
width: 0, // optional
height: 0, // optional
gravity: ImageGravity.Center, // optional
quality: 0, // optional
quality: -1, // optional
borderWidth: 0, // optional
borderColor: "", // optional
borderRadius: 0, // optional
opacity: 0, // optional
rotation: -360, // optional
background: "", // optional
output: ImageFormat.Jpg // optional
output: ImageFormat.Jpg, // optional
token: "<TOKEN>" // optional
);
@@ -11,5 +11,6 @@ Storage storage = new Storage(client);
byte[] result = await storage.GetFileView(
bucketId: "<BUCKET_ID>",
fileId: "<FILE_ID>"
fileId: "<FILE_ID>",
token: "<TOKEN>" // optional
);
@@ -5,13 +5,12 @@ using Appwrite.Services;
Client client = new Client()
.SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.SetProject("<YOUR_PROJECT_ID>") // Your project ID
.SetSession(""); // The user session to authenticate with
.SetKey("<YOUR_API_KEY>"); // Your secret API key
Tokens tokens = new Tokens(client);
ResourceToken result = await tokens.CreateFileToken(
bucketId: "<BUCKET_ID>",
fileId: "<FILE_ID>",
expire: "", // optional
permissions: ["read("any")"] // optional
expire: "" // optional
);
@@ -5,7 +5,7 @@ using Appwrite.Services;
Client client = new Client()
.SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.SetProject("<YOUR_PROJECT_ID>") // Your project ID
.SetSession(""); // The user session to authenticate with
.SetKey("<YOUR_API_KEY>"); // Your secret API key
Tokens tokens = new Tokens(client);
@@ -5,7 +5,7 @@ using Appwrite.Services;
Client client = new Client()
.SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.SetProject("<YOUR_PROJECT_ID>") // Your project ID
.SetSession(""); // The user session to authenticate with
.SetKey("<YOUR_API_KEY>"); // Your secret API key
Tokens tokens = new Tokens(client);
@@ -5,7 +5,7 @@ using Appwrite.Services;
Client client = new Client()
.SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.SetProject("<YOUR_PROJECT_ID>") // Your project ID
.SetSession(""); // The user session to authenticate with
.SetKey("<YOUR_API_KEY>"); // Your secret API key
Tokens tokens = new Tokens(client);
@@ -5,12 +5,11 @@ using Appwrite.Services;
Client client = new Client()
.SetEndPoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.SetProject("<YOUR_PROJECT_ID>") // Your project ID
.SetSession(""); // The user session to authenticate with
.SetKey("<YOUR_API_KEY>"); // Your secret API key
Tokens tokens = new Tokens(client);
ResourceToken result = await tokens.Update(
tokenId: "<TOKEN_ID>",
expire: "", // optional
permissions: ["read("any")"] // optional
expire: "" // optional
);
@@ -18,7 +18,7 @@ func main() {
"aa",
avatars.WithGetBrowserWidth(0),
avatars.WithGetBrowserHeight(0),
avatars.WithGetBrowserQuality(0),
avatars.WithGetBrowserQuality(-1),
)
if error != nil {
@@ -18,7 +18,7 @@ func main() {
"amex",
avatars.WithGetCreditCardWidth(0),
avatars.WithGetCreditCardHeight(0),
avatars.WithGetCreditCardQuality(0),
avatars.WithGetCreditCardQuality(-1),
)
if error != nil {
@@ -18,7 +18,7 @@ func main() {
"af",
avatars.WithGetFlagWidth(0),
avatars.WithGetFlagHeight(0),
avatars.WithGetFlagQuality(0),
avatars.WithGetFlagQuality(-1),
)
if error != nil {
@@ -21,6 +21,7 @@ func main() {
"key",
[]interface{}{},
databases.WithCreateIndexOrders([]interface{}{}),
databases.WithCreateIndexLengths([]interface{}{}),
)
if error != nil {
@@ -17,6 +17,7 @@ func main() {
response, error := service.GetFileDownload(
"<BUCKET_ID>",
"<FILE_ID>",
storage.WithGetFileDownloadToken("<TOKEN>"),
)
if error != nil {
@@ -20,7 +20,7 @@ func main() {
storage.WithGetFilePreviewWidth(0),
storage.WithGetFilePreviewHeight(0),
storage.WithGetFilePreviewGravity("center"),
storage.WithGetFilePreviewQuality(0),
storage.WithGetFilePreviewQuality(-1),
storage.WithGetFilePreviewBorderWidth(0),
storage.WithGetFilePreviewBorderColor(""),
storage.WithGetFilePreviewBorderRadius(0),
@@ -28,6 +28,7 @@ func main() {
storage.WithGetFilePreviewRotation(-360),
storage.WithGetFilePreviewBackground(""),
storage.WithGetFilePreviewOutput("jpg"),
storage.WithGetFilePreviewToken("<TOKEN>"),
)
if error != nil {
@@ -17,6 +17,7 @@ func main() {
response, error := service.GetFileView(
"<BUCKET_ID>",
"<FILE_ID>",
storage.WithGetFileViewToken("<TOKEN>"),
)
if error != nil {
@@ -11,14 +11,13 @@ func main() {
client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
client.SetProject("<YOUR_PROJECT_ID>") // Your project ID
client.SetSession("") // The user session to authenticate with
client.SetKey("<YOUR_API_KEY>") // Your secret API key
service := tokens.NewTokens(client)
response, error := service.CreateFileToken(
"<BUCKET_ID>",
"<FILE_ID>",
tokens.WithCreateFileTokenExpire(""),
tokens.WithCreateFileTokenPermissions(interface{}{"read("any")"}),
)
if error != nil {
@@ -11,7 +11,7 @@ func main() {
client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
client.SetProject("<YOUR_PROJECT_ID>") // Your project ID
client.SetSession("") // The user session to authenticate with
client.SetKey("<YOUR_API_KEY>") // Your secret API key
service := tokens.NewTokens(client)
response, error := service.Delete(
@@ -11,7 +11,7 @@ func main() {
client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
client.SetProject("<YOUR_PROJECT_ID>") // Your project ID
client.SetSession("") // The user session to authenticate with
client.SetKey("<YOUR_API_KEY>") // Your secret API key
service := tokens.NewTokens(client)
response, error := service.Get(
@@ -11,7 +11,7 @@ func main() {
client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
client.SetProject("<YOUR_PROJECT_ID>") // Your project ID
client.SetSession("") // The user session to authenticate with
client.SetKey("<YOUR_API_KEY>") // Your secret API key
service := tokens.NewTokens(client)
response, error := service.List(
@@ -11,13 +11,12 @@ func main() {
client.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
client.SetProject("<YOUR_PROJECT_ID>") // Your project ID
client.SetSession("") // The user session to authenticate with
client.SetKey("<YOUR_API_KEY>") // Your secret API key
service := tokens.NewTokens(client)
response, error := service.Update(
"<TOKEN_ID>",
tokens.WithUpdateExpire(""),
tokens.WithUpdatePermissions(interface{}{"read("any")"}),
)
if error != nil {
@@ -22,6 +22,7 @@ mutation {
status
error
attributes
lengths
orders
_createdAt
_updatedAt

Some files were not shown because too many files have changed in this diff Show More