Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
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
2 changes: 1 addition & 1 deletion docs/examples/avatars/get-browser.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Client client = Client()

Avatars avatars = Avatars(client);

UInt8List result = await avatars.getBrowser(
Uint8List result = await avatars.getBrowser(
code: Browser.avantBrowser,
width: 0, // (optional)
height: 0, // (optional)
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/avatars/get-credit-card.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Client client = Client()

Avatars avatars = Avatars(client);

UInt8List result = await avatars.getCreditCard(
Uint8List result = await avatars.getCreditCard(
code: CreditCard.americanExpress,
width: 0, // (optional)
height: 0, // (optional)
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/avatars/get-favicon.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ Client client = Client()

Avatars avatars = Avatars(client);

UInt8List result = await avatars.getFavicon(
Uint8List result = await avatars.getFavicon(
url: 'https://example.com',
);
2 changes: 1 addition & 1 deletion docs/examples/avatars/get-flag.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Client client = Client()

Avatars avatars = Avatars(client);

UInt8List result = await avatars.getFlag(
Uint8List result = await avatars.getFlag(
code: Flag.afghanistan,
width: 0, // (optional)
height: 0, // (optional)
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/avatars/get-image.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Client client = Client()

Avatars avatars = Avatars(client);

UInt8List result = await avatars.getImage(
Uint8List result = await avatars.getImage(
url: 'https://example.com',
width: 0, // (optional)
height: 0, // (optional)
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/avatars/get-initials.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Client client = Client()

Avatars avatars = Avatars(client);

UInt8List result = await avatars.getInitials(
Uint8List result = await avatars.getInitials(
name: '<NAME>', // (optional)
width: 0, // (optional)
height: 0, // (optional)
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/avatars/get-qr.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Client client = Client()

Avatars avatars = Avatars(client);

UInt8List result = await avatars.getQR(
Uint8List result = await avatars.getQR(
text: '<TEXT>',
size: 1, // (optional)
margin: 0, // (optional)
Expand Down
8 changes: 4 additions & 4 deletions docs/examples/avatars/get-screenshot.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ Client client = Client()

Avatars avatars = Avatars(client);

UInt8List result = await avatars.getScreenshot(
Uint8List result = await avatars.getScreenshot(
url: 'https://example.com',
headers: {}, // (optional)
viewportWidth: 1, // (optional)
viewportHeight: 1, // (optional)
scale: 0.1, // (optional)
theme: .light, // (optional)
theme: Theme.light, // (optional)
userAgent: '<USER_AGENT>', // (optional)
fullpage: false, // (optional)
locale: '<LOCALE>', // (optional)
timezone: .africaAbidjan, // (optional)
timezone: Timezone.africaAbidjan, // (optional)
latitude: -90, // (optional)
longitude: -180, // (optional)
accuracy: 0, // (optional)
Expand All @@ -27,5 +27,5 @@ UInt8List result = await avatars.getScreenshot(
width: 0, // (optional)
height: 0, // (optional)
quality: -1, // (optional)
output: .jpg, // (optional)
output: Output.jpg, // (optional)
);
3 changes: 2 additions & 1 deletion docs/examples/functions/create-template-deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Deployment result = await functions.createTemplateDeployment(
repository: '<REPOSITORY>',
owner: '<OWNER>',
rootDirectory: '<ROOT_DIRECTORY>',
version: '<VERSION>',
type: TemplateReferenceType.commit,
reference: '<REFERENCE>',
activate: false, // (optional)
);
2 changes: 1 addition & 1 deletion docs/examples/functions/create-vcs-deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Functions functions = Functions(client);

Deployment result = await functions.createVcsDeployment(
functionId: '<FUNCTION_ID>',
type: VCSDeploymentType.branch,
type: VCSReferenceType.branch,
reference: '<REFERENCE>',
activate: false, // (optional)
);
2 changes: 1 addition & 1 deletion docs/examples/functions/create.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Functions functions = Functions(client);
Func result = await functions.create(
functionId: '<FUNCTION_ID>',
name: '<NAME>',
runtime: .node145,
runtime: Runtime.node145,
execute: ["any"], // (optional)
events: [], // (optional)
schedule: '', // (optional)
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/functions/get-deployment-download.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Client client = Client()

Functions functions = Functions(client);

UInt8List result = await functions.getDeploymentDownload(
Uint8List result = await functions.getDeploymentDownload(
functionId: '<FUNCTION_ID>',
deploymentId: '<DEPLOYMENT_ID>',
type: DeploymentDownloadType.source, // (optional)
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/functions/update.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Functions functions = Functions(client);
Func result = await functions.update(
functionId: '<FUNCTION_ID>',
name: '<NAME>',
runtime: .node145, // (optional)
runtime: Runtime.node145, // (optional)
execute: ["any"], // (optional)
events: [], // (optional)
schedule: '', // (optional)
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/health/get-failed-jobs.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ Client client = Client()
Health health = Health(client);

HealthQueue result = await health.getFailedJobs(
name: .v1Database,
name: Name.v1Database,
threshold: 0, // (optional)
);
3 changes: 2 additions & 1 deletion docs/examples/sites/create-template-deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Deployment result = await sites.createTemplateDeployment(
repository: '<REPOSITORY>',
owner: '<OWNER>',
rootDirectory: '<ROOT_DIRECTORY>',
version: '<VERSION>',
type: TemplateReferenceType.branch,
reference: '<REFERENCE>',
activate: false, // (optional)
);
2 changes: 1 addition & 1 deletion docs/examples/sites/create-vcs-deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Sites sites = Sites(client);

Deployment result = await sites.createVcsDeployment(
siteId: '<SITE_ID>',
type: VCSDeploymentType.branch,
type: VCSReferenceType.branch,
reference: '<REFERENCE>',
activate: false, // (optional)
);
6 changes: 3 additions & 3 deletions docs/examples/sites/create.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ Sites sites = Sites(client);
Site result = await sites.create(
siteId: '<SITE_ID>',
name: '<NAME>',
framework: .analog,
buildRuntime: .node145,
framework: Framework.analog,
buildRuntime: BuildRuntime.node145,
enabled: false, // (optional)
logging: false, // (optional)
timeout: 1, // (optional)
installCommand: '<INSTALL_COMMAND>', // (optional)
buildCommand: '<BUILD_COMMAND>', // (optional)
outputDirectory: '<OUTPUT_DIRECTORY>', // (optional)
adapter: .static, // (optional)
adapter: Adapter.static, // (optional)
installationId: '<INSTALLATION_ID>', // (optional)
fallbackFile: '<FALLBACK_FILE>', // (optional)
providerRepositoryId: '<PROVIDER_REPOSITORY_ID>', // (optional)
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/sites/get-deployment-download.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Client client = Client()

Sites sites = Sites(client);

UInt8List result = await sites.getDeploymentDownload(
Uint8List result = await sites.getDeploymentDownload(
siteId: '<SITE_ID>',
deploymentId: '<DEPLOYMENT_ID>',
type: DeploymentDownloadType.source, // (optional)
Expand Down
6 changes: 3 additions & 3 deletions docs/examples/sites/update.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ Sites sites = Sites(client);
Site result = await sites.update(
siteId: '<SITE_ID>',
name: '<NAME>',
framework: .analog,
framework: Framework.analog,
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Find the main SDK files and enum definitions
# First, let's see the repository structure
git ls-files | head -20

# Look for TypeScript/JavaScript enum definitions
fd -e ts -e js -e tsx -e jsx | grep -v node_modules | head -30

Repository: appwrite/sdk-for-dart

Length of output: 776


🏁 Script executed:

#!/bin/bash
# Find Dart files with enum definitions
fd -e dart | grep -v pubspec | head -30

# Look for enum definitions in Dart files
rg -n "enum Framework\|enum BuildRuntime\|enum Adapter" --type dart

Repository: appwrite/sdk-for-dart

Length of output: 750


🏁 Script executed:

#!/bin/bash
# Check the size of enums.dart
wc -l lib/enums.dart

# Read the entire file to find the enums
cat -n lib/enums.dart

Repository: appwrite/sdk-for-dart

Length of output: 1851


🏁 Script executed:

#!/bin/bash
# Read the three enum files
echo "=== framework.dart ==="
cat -n lib/src/enums/framework.dart

echo -e "\n=== build_runtime.dart ==="
cat -n lib/src/enums/build_runtime.dart

echo -e "\n=== adapter.dart ==="
cat -n lib/src/enums/adapter.dart

Repository: appwrite/sdk-for-dart

Length of output: 3918


🏁 Script executed:

#!/bin/bash
# Read the update.md file to see the actual enum usage
cat -n docs/examples/sites/update.md

Repository: appwrite/sdk-for-dart

Length of output: 1418


The enum value Adapter.static does not exist; it should be Adapter.xstatic.

The verification found that Framework.analog and BuildRuntime.node145 are valid enum values in the SDK. However, Adapter.static is incorrect. The actual enum member in lib/src/enums/adapter.dart (line 4) is named Adapter.xstatic, which has the string value 'static'. The documentation file at line 21 must be updated to use Adapter.xstatic instead of Adapter.static.

🤖 Prompt for AI Agents
In docs/examples/sites/update.md around line 13, the code uses a non-existent
enum member Adapter.static; replace it with the correct enum member
Adapter.xstatic (the enum is defined in lib/src/enums/adapter.dart and xstatic
has the string value 'static') so the example compiles and matches the SDK enum
names.

enabled: false, // (optional)
logging: false, // (optional)
timeout: 1, // (optional)
installCommand: '<INSTALL_COMMAND>', // (optional)
buildCommand: '<BUILD_COMMAND>', // (optional)
outputDirectory: '<OUTPUT_DIRECTORY>', // (optional)
buildRuntime: .node145, // (optional)
adapter: .static, // (optional)
buildRuntime: BuildRuntime.node145, // (optional)
adapter: Adapter.static, // (optional)
fallbackFile: '<FALLBACK_FILE>', // (optional)
installationId: '<INSTALLATION_ID>', // (optional)
providerRepositoryId: '<PROVIDER_REPOSITORY_ID>', // (optional)
Expand Down
3 changes: 2 additions & 1 deletion docs/examples/storage/create-bucket.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ Bucket result = await storage.createBucket(
enabled: false, // (optional)
maximumFileSize: 1, // (optional)
allowedFileExtensions: [], // (optional)
compression: .none, // (optional)
compression: Compression.none, // (optional)
encryption: false, // (optional)
antivirus: false, // (optional)
transformations: false, // (optional)
);
2 changes: 1 addition & 1 deletion docs/examples/storage/get-file-download.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Client client = Client()

Storage storage = Storage(client);

UInt8List result = await storage.getFileDownload(
Uint8List result = await storage.getFileDownload(
bucketId: '<BUCKET_ID>',
fileId: '<FILE_ID>',
token: '<TOKEN>', // (optional)
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/storage/get-file-preview.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Client client = Client()

Storage storage = Storage(client);

UInt8List result = await storage.getFilePreview(
Uint8List result = await storage.getFilePreview(
bucketId: '<BUCKET_ID>',
fileId: '<FILE_ID>',
width: 0, // (optional)
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/storage/get-file-view.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Client client = Client()

Storage storage = Storage(client);

UInt8List result = await storage.getFileView(
Uint8List result = await storage.getFileView(
bucketId: '<BUCKET_ID>',
fileId: '<FILE_ID>',
token: '<TOKEN>', // (optional)
Expand Down
3 changes: 2 additions & 1 deletion docs/examples/storage/update-bucket.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ Bucket result = await storage.updateBucket(
enabled: false, // (optional)
maximumFileSize: 1, // (optional)
allowedFileExtensions: [], // (optional)
compression: .none, // (optional)
compression: Compression.none, // (optional)
encryption: false, // (optional)
antivirus: false, // (optional)
transformations: false, // (optional)
);
3 changes: 2 additions & 1 deletion lib/enums.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ part 'src/enums/relationship_type.dart';
part 'src/enums/relation_mutate.dart';
part 'src/enums/index_type.dart';
part 'src/enums/runtime.dart';
part 'src/enums/vcs_deployment_type.dart';
part 'src/enums/template_reference_type.dart';
part 'src/enums/vcs_reference_type.dart';
part 'src/enums/deployment_download_type.dart';
part 'src/enums/execution_method.dart';
part 'src/enums/name.dart';
Expand Down
Loading