diff --git a/CHANGELOG.md b/CHANGELOG.md index 7fd7227f..49d45bec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Change Log +## 20.0.0 + +* Rename `VCSDeploymentType` enum to `VCSReferenceType` +* Change `createTemplateDeployment` method signature: replace `version` parameter with `type` (TemplateReferenceType) and `reference` parameters +* Add `Theme`, `Timezone` and `Output` enums + ## 19.4.0 * Add `getScreenshot` method to `Avatars` service diff --git a/README.md b/README.md index feb6c241..d6815868 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ Add this to your package's `pubspec.yaml` file: ```yml dependencies: - dart_appwrite: ^19.4.0 + dart_appwrite: ^20.0.0 ``` You can install packages from the command line: diff --git a/docs/examples/avatars/get-browser.md b/docs/examples/avatars/get-browser.md index 8d528751..1f326e80 100644 --- a/docs/examples/avatars/get-browser.md +++ b/docs/examples/avatars/get-browser.md @@ -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) diff --git a/docs/examples/avatars/get-credit-card.md b/docs/examples/avatars/get-credit-card.md index 88fe35eb..8232d7b2 100644 --- a/docs/examples/avatars/get-credit-card.md +++ b/docs/examples/avatars/get-credit-card.md @@ -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) diff --git a/docs/examples/avatars/get-favicon.md b/docs/examples/avatars/get-favicon.md index d4cd8eae..e2df21f6 100644 --- a/docs/examples/avatars/get-favicon.md +++ b/docs/examples/avatars/get-favicon.md @@ -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', ); diff --git a/docs/examples/avatars/get-flag.md b/docs/examples/avatars/get-flag.md index 56046681..0aea028e 100644 --- a/docs/examples/avatars/get-flag.md +++ b/docs/examples/avatars/get-flag.md @@ -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) diff --git a/docs/examples/avatars/get-image.md b/docs/examples/avatars/get-image.md index b6db1858..fc727f48 100644 --- a/docs/examples/avatars/get-image.md +++ b/docs/examples/avatars/get-image.md @@ -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) diff --git a/docs/examples/avatars/get-initials.md b/docs/examples/avatars/get-initials.md index 7dc0989b..be77c671 100644 --- a/docs/examples/avatars/get-initials.md +++ b/docs/examples/avatars/get-initials.md @@ -7,7 +7,7 @@ Client client = Client() Avatars avatars = Avatars(client); -UInt8List result = await avatars.getInitials( +Uint8List result = await avatars.getInitials( name: '', // (optional) width: 0, // (optional) height: 0, // (optional) diff --git a/docs/examples/avatars/get-qr.md b/docs/examples/avatars/get-qr.md index f64fe8a4..f44ce590 100644 --- a/docs/examples/avatars/get-qr.md +++ b/docs/examples/avatars/get-qr.md @@ -7,7 +7,7 @@ Client client = Client() Avatars avatars = Avatars(client); -UInt8List result = await avatars.getQR( +Uint8List result = await avatars.getQR( text: '', size: 1, // (optional) margin: 0, // (optional) diff --git a/docs/examples/avatars/get-screenshot.md b/docs/examples/avatars/get-screenshot.md index 7630648f..da80f30b 100644 --- a/docs/examples/avatars/get-screenshot.md +++ b/docs/examples/avatars/get-screenshot.md @@ -7,25 +7,28 @@ 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) - userAgent: '', // (optional) - fullpage: false, // (optional) - locale: '', // (optional) - timezone: .africaAbidjan, // (optional) - latitude: -90, // (optional) - longitude: -180, // (optional) - accuracy: 0, // (optional) - touch: false, // (optional) - permissions: [], // (optional) - sleep: 0, // (optional) - width: 0, // (optional) - height: 0, // (optional) - quality: -1, // (optional) - output: .jpg, // (optional) + headers: { + "Authorization": "Bearer token123", + "X-Custom-Header": "value" + }, // (optional) + viewportWidth: 1920, // (optional) + viewportHeight: 1080, // (optional) + scale: 2, // (optional) + theme: Theme.light, // (optional) + userAgent: 'Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15', // (optional) + fullpage: true, // (optional) + locale: 'en-US', // (optional) + timezone: Timezone.africaAbidjan, // (optional) + latitude: 37.7749, // (optional) + longitude: -122.4194, // (optional) + accuracy: 100, // (optional) + touch: true, // (optional) + permissions: ["geolocation","notifications"], // (optional) + sleep: 3, // (optional) + width: 800, // (optional) + height: 600, // (optional) + quality: 85, // (optional) + output: Output.jpg, // (optional) ); diff --git a/docs/examples/functions/create-template-deployment.md b/docs/examples/functions/create-template-deployment.md index cc293b0c..f5b6cdeb 100644 --- a/docs/examples/functions/create-template-deployment.md +++ b/docs/examples/functions/create-template-deployment.md @@ -12,6 +12,7 @@ Deployment result = await functions.createTemplateDeployment( repository: '', owner: '', rootDirectory: '', - version: '', + type: TemplateReferenceType.commit, + reference: '', activate: false, // (optional) ); diff --git a/docs/examples/functions/create-vcs-deployment.md b/docs/examples/functions/create-vcs-deployment.md index ed315a54..0c12315f 100644 --- a/docs/examples/functions/create-vcs-deployment.md +++ b/docs/examples/functions/create-vcs-deployment.md @@ -9,7 +9,7 @@ Functions functions = Functions(client); Deployment result = await functions.createVcsDeployment( functionId: '', - type: VCSDeploymentType.branch, + type: VCSReferenceType.branch, reference: '', activate: false, // (optional) ); diff --git a/docs/examples/functions/create.md b/docs/examples/functions/create.md index f3f26830..2276872e 100644 --- a/docs/examples/functions/create.md +++ b/docs/examples/functions/create.md @@ -10,7 +10,7 @@ Functions functions = Functions(client); Func result = await functions.create( functionId: '', name: '', - runtime: .node145, + runtime: Runtime.node145, execute: ["any"], // (optional) events: [], // (optional) schedule: '', // (optional) diff --git a/docs/examples/functions/get-deployment-download.md b/docs/examples/functions/get-deployment-download.md index e7bbacf3..1b93e3ba 100644 --- a/docs/examples/functions/get-deployment-download.md +++ b/docs/examples/functions/get-deployment-download.md @@ -7,7 +7,7 @@ Client client = Client() Functions functions = Functions(client); -UInt8List result = await functions.getDeploymentDownload( +Uint8List result = await functions.getDeploymentDownload( functionId: '', deploymentId: '', type: DeploymentDownloadType.source, // (optional) diff --git a/docs/examples/functions/update.md b/docs/examples/functions/update.md index ebe3be8c..bf3e39cc 100644 --- a/docs/examples/functions/update.md +++ b/docs/examples/functions/update.md @@ -10,7 +10,7 @@ Functions functions = Functions(client); Func result = await functions.update( functionId: '', name: '', - runtime: .node145, // (optional) + runtime: Runtime.node145, // (optional) execute: ["any"], // (optional) events: [], // (optional) schedule: '', // (optional) diff --git a/docs/examples/health/get-failed-jobs.md b/docs/examples/health/get-failed-jobs.md index 6f80718f..b375c579 100644 --- a/docs/examples/health/get-failed-jobs.md +++ b/docs/examples/health/get-failed-jobs.md @@ -8,6 +8,6 @@ Client client = Client() Health health = Health(client); HealthQueue result = await health.getFailedJobs( - name: .v1Database, + name: Name.v1Database, threshold: 0, // (optional) ); diff --git a/docs/examples/sites/create-template-deployment.md b/docs/examples/sites/create-template-deployment.md index 348b4652..8826b1f4 100644 --- a/docs/examples/sites/create-template-deployment.md +++ b/docs/examples/sites/create-template-deployment.md @@ -12,6 +12,7 @@ Deployment result = await sites.createTemplateDeployment( repository: '', owner: '', rootDirectory: '', - version: '', + type: TemplateReferenceType.branch, + reference: '', activate: false, // (optional) ); diff --git a/docs/examples/sites/create-vcs-deployment.md b/docs/examples/sites/create-vcs-deployment.md index 50f65b96..52133a53 100644 --- a/docs/examples/sites/create-vcs-deployment.md +++ b/docs/examples/sites/create-vcs-deployment.md @@ -9,7 +9,7 @@ Sites sites = Sites(client); Deployment result = await sites.createVcsDeployment( siteId: '', - type: VCSDeploymentType.branch, + type: VCSReferenceType.branch, reference: '', activate: false, // (optional) ); diff --git a/docs/examples/sites/create.md b/docs/examples/sites/create.md index 448abab1..e6ec4a6d 100644 --- a/docs/examples/sites/create.md +++ b/docs/examples/sites/create.md @@ -10,15 +10,15 @@ Sites sites = Sites(client); Site result = await sites.create( siteId: '', name: '', - framework: .analog, - buildRuntime: .node145, + framework: Framework.analog, + buildRuntime: BuildRuntime.node145, enabled: false, // (optional) logging: false, // (optional) timeout: 1, // (optional) installCommand: '', // (optional) buildCommand: '', // (optional) outputDirectory: '', // (optional) - adapter: .static, // (optional) + adapter: Adapter.static, // (optional) installationId: '', // (optional) fallbackFile: '', // (optional) providerRepositoryId: '', // (optional) diff --git a/docs/examples/sites/get-deployment-download.md b/docs/examples/sites/get-deployment-download.md index ad21070b..f6bbb3c3 100644 --- a/docs/examples/sites/get-deployment-download.md +++ b/docs/examples/sites/get-deployment-download.md @@ -7,7 +7,7 @@ Client client = Client() Sites sites = Sites(client); -UInt8List result = await sites.getDeploymentDownload( +Uint8List result = await sites.getDeploymentDownload( siteId: '', deploymentId: '', type: DeploymentDownloadType.source, // (optional) diff --git a/docs/examples/sites/update.md b/docs/examples/sites/update.md index c13acfb2..2cfd6863 100644 --- a/docs/examples/sites/update.md +++ b/docs/examples/sites/update.md @@ -10,15 +10,15 @@ Sites sites = Sites(client); Site result = await sites.update( siteId: '', name: '', - framework: .analog, + framework: Framework.analog, enabled: false, // (optional) logging: false, // (optional) timeout: 1, // (optional) installCommand: '', // (optional) buildCommand: '', // (optional) outputDirectory: '', // (optional) - buildRuntime: .node145, // (optional) - adapter: .static, // (optional) + buildRuntime: BuildRuntime.node145, // (optional) + adapter: Adapter.static, // (optional) fallbackFile: '', // (optional) installationId: '', // (optional) providerRepositoryId: '', // (optional) diff --git a/docs/examples/storage/create-bucket.md b/docs/examples/storage/create-bucket.md index 79357d0e..3d306bd4 100644 --- a/docs/examples/storage/create-bucket.md +++ b/docs/examples/storage/create-bucket.md @@ -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) ); diff --git a/docs/examples/storage/get-file-download.md b/docs/examples/storage/get-file-download.md index 8c119c38..34f40685 100644 --- a/docs/examples/storage/get-file-download.md +++ b/docs/examples/storage/get-file-download.md @@ -7,7 +7,7 @@ Client client = Client() Storage storage = Storage(client); -UInt8List result = await storage.getFileDownload( +Uint8List result = await storage.getFileDownload( bucketId: '', fileId: '', token: '', // (optional) diff --git a/docs/examples/storage/get-file-preview.md b/docs/examples/storage/get-file-preview.md index a1f3c09b..a14e12c6 100644 --- a/docs/examples/storage/get-file-preview.md +++ b/docs/examples/storage/get-file-preview.md @@ -7,7 +7,7 @@ Client client = Client() Storage storage = Storage(client); -UInt8List result = await storage.getFilePreview( +Uint8List result = await storage.getFilePreview( bucketId: '', fileId: '', width: 0, // (optional) diff --git a/docs/examples/storage/get-file-view.md b/docs/examples/storage/get-file-view.md index d48b51c1..a1d9271f 100644 --- a/docs/examples/storage/get-file-view.md +++ b/docs/examples/storage/get-file-view.md @@ -7,7 +7,7 @@ Client client = Client() Storage storage = Storage(client); -UInt8List result = await storage.getFileView( +Uint8List result = await storage.getFileView( bucketId: '', fileId: '', token: '', // (optional) diff --git a/docs/examples/storage/update-bucket.md b/docs/examples/storage/update-bucket.md index f3eea941..e81b4586 100644 --- a/docs/examples/storage/update-bucket.md +++ b/docs/examples/storage/update-bucket.md @@ -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) ); diff --git a/lib/enums.dart b/lib/enums.dart index 85bb7850..7c079637 100644 --- a/lib/enums.dart +++ b/lib/enums.dart @@ -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'; diff --git a/lib/services/account.dart b/lib/services/account.dart index 80af98eb..eeaa64bc 100644 --- a/lib/services/account.dart +++ b/lib/services/account.dart @@ -300,7 +300,7 @@ class Account extends Service { 'This API has been deprecated since 1.8.0. Please use `Account.createMFAChallenge` instead.') Future createMfaChallenge( {required enums.AuthenticationFactor factor}) async { - final String apiPath = '/account/mfa/challenge'; + final String apiPath = '/account/mfa/challenges'; final Map apiParams = { 'factor': factor.value, @@ -321,7 +321,7 @@ class Account extends Service { /// method. Future createMFAChallenge( {required enums.AuthenticationFactor factor}) async { - final String apiPath = '/account/mfa/challenge'; + final String apiPath = '/account/mfa/challenges'; final Map apiParams = { 'factor': factor.value, @@ -346,7 +346,7 @@ class Account extends Service { 'This API has been deprecated since 1.8.0. Please use `Account.updateMFAChallenge` instead.') Future updateMfaChallenge( {required String challengeId, required String otp}) async { - final String apiPath = '/account/mfa/challenge'; + final String apiPath = '/account/mfa/challenges'; final Map apiParams = { 'challengeId': challengeId, @@ -370,7 +370,7 @@ class Account extends Service { /// method. Future updateMFAChallenge( {required String challengeId, required String otp}) async { - final String apiPath = '/account/mfa/challenge'; + final String apiPath = '/account/mfa/challenges'; final Map apiParams = { 'challengeId': challengeId, diff --git a/lib/services/databases.dart b/lib/services/databases.dart index 12f4ea1a..3d7e5590 100644 --- a/lib/services/databases.dart +++ b/lib/services/databases.dart @@ -266,7 +266,7 @@ class Databases extends Service { final Map apiParams = { 'collectionId': collectionId, 'name': name, - if (permissions != null) 'permissions': permissions, + 'permissions': permissions, if (documentSecurity != null) 'documentSecurity': documentSecurity, if (enabled != null) 'enabled': enabled, }; @@ -317,7 +317,7 @@ class Databases extends Service { final Map apiParams = { 'name': name, - if (permissions != null) 'permissions': permissions, + 'permissions': permissions, if (documentSecurity != null) 'documentSecurity': documentSecurity, if (enabled != null) 'enabled': enabled, }; @@ -399,7 +399,7 @@ class Databases extends Service { final Map apiParams = { 'key': key, 'required': xrequired, - if (xdefault != null) 'default': xdefault, + 'default': xdefault, if (array != null) 'array': array, }; @@ -433,7 +433,7 @@ class Databases extends Service { final Map apiParams = { 'required': xrequired, 'default': xdefault, - if (newKey != null) 'newKey': newKey, + 'newKey': newKey, }; final Map apiHeaders = { @@ -464,7 +464,7 @@ class Databases extends Service { final Map apiParams = { 'key': key, 'required': xrequired, - if (xdefault != null) 'default': xdefault, + 'default': xdefault, if (array != null) 'array': array, }; @@ -498,7 +498,7 @@ class Databases extends Service { final Map apiParams = { 'required': xrequired, 'default': xdefault, - if (newKey != null) 'newKey': newKey, + 'newKey': newKey, }; final Map apiHeaders = { @@ -530,7 +530,7 @@ class Databases extends Service { final Map apiParams = { 'key': key, 'required': xrequired, - if (xdefault != null) 'default': xdefault, + 'default': xdefault, if (array != null) 'array': array, }; @@ -565,7 +565,7 @@ class Databases extends Service { final Map apiParams = { 'required': xrequired, 'default': xdefault, - if (newKey != null) 'newKey': newKey, + 'newKey': newKey, }; final Map apiHeaders = { @@ -600,7 +600,7 @@ class Databases extends Service { 'key': key, 'elements': elements, 'required': xrequired, - if (xdefault != null) 'default': xdefault, + 'default': xdefault, if (array != null) 'array': array, }; @@ -637,7 +637,7 @@ class Databases extends Service { 'elements': elements, 'required': xrequired, 'default': xdefault, - if (newKey != null) 'newKey': newKey, + 'newKey': newKey, }; final Map apiHeaders = { @@ -672,9 +672,9 @@ class Databases extends Service { final Map apiParams = { 'key': key, 'required': xrequired, - if (min != null) 'min': min, - if (max != null) 'max': max, - if (xdefault != null) 'default': xdefault, + 'min': min, + 'max': max, + 'default': xdefault, if (array != null) 'array': array, }; @@ -710,10 +710,10 @@ class Databases extends Service { final Map apiParams = { 'required': xrequired, - if (min != null) 'min': min, - if (max != null) 'max': max, + 'min': min, + 'max': max, 'default': xdefault, - if (newKey != null) 'newKey': newKey, + 'newKey': newKey, }; final Map apiHeaders = { @@ -748,9 +748,9 @@ class Databases extends Service { final Map apiParams = { 'key': key, 'required': xrequired, - if (min != null) 'min': min, - if (max != null) 'max': max, - if (xdefault != null) 'default': xdefault, + 'min': min, + 'max': max, + 'default': xdefault, if (array != null) 'array': array, }; @@ -786,10 +786,10 @@ class Databases extends Service { final Map apiParams = { 'required': xrequired, - if (min != null) 'min': min, - if (max != null) 'max': max, + 'min': min, + 'max': max, 'default': xdefault, - if (newKey != null) 'newKey': newKey, + 'newKey': newKey, }; final Map apiHeaders = { @@ -821,7 +821,7 @@ class Databases extends Service { final Map apiParams = { 'key': key, 'required': xrequired, - if (xdefault != null) 'default': xdefault, + 'default': xdefault, if (array != null) 'array': array, }; @@ -856,7 +856,7 @@ class Databases extends Service { final Map apiParams = { 'required': xrequired, 'default': xdefault, - if (newKey != null) 'newKey': newKey, + 'newKey': newKey, }; final Map apiHeaders = { @@ -919,7 +919,7 @@ class Databases extends Service { final Map apiParams = { 'required': xrequired, 'default': xdefault, - if (newKey != null) 'newKey': newKey, + 'newKey': newKey, }; final Map apiHeaders = { @@ -982,7 +982,7 @@ class Databases extends Service { final Map apiParams = { 'required': xrequired, 'default': xdefault, - if (newKey != null) 'newKey': newKey, + 'newKey': newKey, }; final Map apiHeaders = { @@ -1045,7 +1045,7 @@ class Databases extends Service { final Map apiParams = { 'required': xrequired, 'default': xdefault, - if (newKey != null) 'newKey': newKey, + 'newKey': newKey, }; final Map apiHeaders = { @@ -1081,8 +1081,8 @@ class Databases extends Service { 'relatedCollectionId': relatedCollectionId, 'type': type.value, if (twoWay != null) 'twoWay': twoWay, - if (key != null) 'key': key, - if (twoWayKey != null) 'twoWayKey': twoWayKey, + 'key': key, + 'twoWayKey': twoWayKey, if (onDelete != null) 'onDelete': onDelete!.value, }; @@ -1118,7 +1118,7 @@ class Databases extends Service { 'key': key, 'size': size, 'required': xrequired, - if (xdefault != null) 'default': xdefault, + 'default': xdefault, if (array != null) 'array': array, if (encrypt != null) 'encrypt': encrypt, }; @@ -1155,8 +1155,8 @@ class Databases extends Service { final Map apiParams = { 'required': xrequired, 'default': xdefault, - if (size != null) 'size': size, - if (newKey != null) 'newKey': newKey, + 'size': size, + 'newKey': newKey, }; final Map apiHeaders = { @@ -1188,7 +1188,7 @@ class Databases extends Service { final Map apiParams = { 'key': key, 'required': xrequired, - if (xdefault != null) 'default': xdefault, + 'default': xdefault, if (array != null) 'array': array, }; @@ -1223,7 +1223,7 @@ class Databases extends Service { final Map apiParams = { 'required': xrequired, 'default': xdefault, - if (newKey != null) 'newKey': newKey, + 'newKey': newKey, }; final Map apiHeaders = { @@ -1302,8 +1302,8 @@ class Databases extends Service { .replaceAll('{key}', key); final Map apiParams = { - if (onDelete != null) 'onDelete': onDelete!.value, - if (newKey != null) 'newKey': newKey, + 'onDelete': onDelete?.value, + 'newKey': newKey, }; final Map apiHeaders = { @@ -1366,8 +1366,8 @@ class Databases extends Service { final Map apiParams = { 'documentId': documentId, 'data': data, - if (permissions != null) 'permissions': permissions, - if (transactionId != null) 'transactionId': transactionId, + 'permissions': permissions, + 'transactionId': transactionId, }; final Map apiHeaders = { @@ -1398,7 +1398,7 @@ class Databases extends Service { final Map apiParams = { 'documents': documents, - if (transactionId != null) 'transactionId': transactionId, + 'transactionId': transactionId, }; final Map apiHeaders = { @@ -1430,7 +1430,7 @@ class Databases extends Service { final Map apiParams = { 'documents': documents, - if (transactionId != null) 'transactionId': transactionId, + 'transactionId': transactionId, }; final Map apiHeaders = { @@ -1462,7 +1462,7 @@ class Databases extends Service { final Map apiParams = { if (data != null) 'data': data, if (queries != null) 'queries': queries, - if (transactionId != null) 'transactionId': transactionId, + 'transactionId': transactionId, }; final Map apiHeaders = { @@ -1491,7 +1491,7 @@ class Databases extends Service { final Map apiParams = { if (queries != null) 'queries': queries, - if (transactionId != null) 'transactionId': transactionId, + 'transactionId': transactionId, }; final Map apiHeaders = { @@ -1554,8 +1554,8 @@ class Databases extends Service { final Map apiParams = { 'data': data, - if (permissions != null) 'permissions': permissions, - if (transactionId != null) 'transactionId': transactionId, + 'permissions': permissions, + 'transactionId': transactionId, }; final Map apiHeaders = { @@ -1587,8 +1587,8 @@ class Databases extends Service { final Map apiParams = { if (data != null) 'data': data, - if (permissions != null) 'permissions': permissions, - if (transactionId != null) 'transactionId': transactionId, + 'permissions': permissions, + 'transactionId': transactionId, }; final Map apiHeaders = { @@ -1616,7 +1616,7 @@ class Databases extends Service { .replaceAll('{documentId}', documentId); final Map apiParams = { - if (transactionId != null) 'transactionId': transactionId, + 'transactionId': transactionId, }; final Map apiHeaders = { @@ -1649,8 +1649,8 @@ class Databases extends Service { final Map apiParams = { if (value != null) 'value': value, - if (min != null) 'min': min, - if (transactionId != null) 'transactionId': transactionId, + 'min': min, + 'transactionId': transactionId, }; final Map apiHeaders = { @@ -1683,8 +1683,8 @@ class Databases extends Service { final Map apiParams = { if (value != null) 'value': value, - if (max != null) 'max': max, - if (transactionId != null) 'transactionId': transactionId, + 'max': max, + 'transactionId': transactionId, }; final Map apiHeaders = { diff --git a/lib/services/functions.dart b/lib/services/functions.dart index 77e36a67..ca091c16 100644 --- a/lib/services/functions.dart +++ b/lib/services/functions.dart @@ -324,7 +324,8 @@ class Functions extends Service { required String repository, required String owner, required String rootDirectory, - required String version, + required enums.TemplateReferenceType type, + required String reference, bool? activate}) async { final String apiPath = '/functions/{functionId}/deployments/template' .replaceAll('{functionId}', functionId); @@ -333,7 +334,8 @@ class Functions extends Service { 'repository': repository, 'owner': owner, 'rootDirectory': rootDirectory, - 'version': version, + 'type': type.value, + 'reference': reference, if (activate != null) 'activate': activate, }; @@ -352,7 +354,7 @@ class Functions extends Service { /// This endpoint lets you create deployment from a branch, commit, or a tag. Future createVcsDeployment( {required String functionId, - required enums.VCSDeploymentType type, + required enums.VCSReferenceType type, required String reference, bool? activate}) async { final String apiPath = '/functions/{functionId}/deployments/vcs' @@ -498,7 +500,7 @@ class Functions extends Service { if (path != null) 'path': path, if (method != null) 'method': method!.value, if (headers != null) 'headers': headers, - if (scheduledAt != null) 'scheduledAt': scheduledAt, + 'scheduledAt': scheduledAt, }; final Map apiHeaders = { @@ -619,8 +621,8 @@ class Functions extends Service { final Map apiParams = { 'key': key, - if (value != null) 'value': value, - if (secret != null) 'secret': secret, + 'value': value, + 'secret': secret, }; final Map apiHeaders = { diff --git a/lib/services/messaging.dart b/lib/services/messaging.dart index 280b57e7..30f65451 100644 --- a/lib/services/messaging.dart +++ b/lib/services/messaging.dart @@ -52,7 +52,7 @@ class Messaging extends Service { if (attachments != null) 'attachments': attachments, if (draft != null) 'draft': draft, if (html != null) 'html': html, - if (scheduledAt != null) 'scheduledAt': scheduledAt, + 'scheduledAt': scheduledAt, }; final Map apiHeaders = { @@ -86,17 +86,17 @@ class Messaging extends Service { .replaceAll('{messageId}', messageId); final Map apiParams = { - if (topics != null) 'topics': topics, - if (users != null) 'users': users, - if (targets != null) 'targets': targets, - if (subject != null) 'subject': subject, - if (content != null) 'content': content, - if (draft != null) 'draft': draft, - if (html != null) 'html': html, - if (cc != null) 'cc': cc, - if (bcc != null) 'bcc': bcc, - if (scheduledAt != null) 'scheduledAt': scheduledAt, - if (attachments != null) 'attachments': attachments, + 'topics': topics, + 'users': users, + 'targets': targets, + 'subject': subject, + 'content': content, + 'draft': draft, + 'html': html, + 'cc': cc, + 'bcc': bcc, + 'scheduledAt': scheduledAt, + 'attachments': attachments, }; final Map apiHeaders = { @@ -139,7 +139,7 @@ class Messaging extends Service { if (topics != null) 'topics': topics, if (users != null) 'users': users, if (targets != null) 'targets': targets, - if (data != null) 'data': data, + 'data': data, if (action != null) 'action': action, if (image != null) 'image': image, if (icon != null) 'icon': icon, @@ -148,7 +148,7 @@ class Messaging extends Service { if (tag != null) 'tag': tag, if (badge != null) 'badge': badge, if (draft != null) 'draft': draft, - if (scheduledAt != null) 'scheduledAt': scheduledAt, + 'scheduledAt': scheduledAt, if (contentAvailable != null) 'contentAvailable': contentAvailable, if (critical != null) 'critical': critical, if (priority != null) 'priority': priority!.value, @@ -192,24 +192,24 @@ class Messaging extends Service { .replaceAll('{messageId}', messageId); final Map apiParams = { - if (topics != null) 'topics': topics, - if (users != null) 'users': users, - if (targets != null) 'targets': targets, - if (title != null) 'title': title, - if (body != null) 'body': body, - if (data != null) 'data': data, - if (action != null) 'action': action, - if (image != null) 'image': image, - if (icon != null) 'icon': icon, - if (sound != null) 'sound': sound, - if (color != null) 'color': color, - if (tag != null) 'tag': tag, - if (badge != null) 'badge': badge, - if (draft != null) 'draft': draft, - if (scheduledAt != null) 'scheduledAt': scheduledAt, - if (contentAvailable != null) 'contentAvailable': contentAvailable, - if (critical != null) 'critical': critical, - if (priority != null) 'priority': priority!.value, + 'topics': topics, + 'users': users, + 'targets': targets, + 'title': title, + 'body': body, + 'data': data, + 'action': action, + 'image': image, + 'icon': icon, + 'sound': sound, + 'color': color, + 'tag': tag, + 'badge': badge, + 'draft': draft, + 'scheduledAt': scheduledAt, + 'contentAvailable': contentAvailable, + 'critical': critical, + 'priority': priority?.value, }; final Map apiHeaders = { @@ -242,7 +242,7 @@ class Messaging extends Service { if (users != null) 'users': users, if (targets != null) 'targets': targets, if (draft != null) 'draft': draft, - if (scheduledAt != null) 'scheduledAt': scheduledAt, + 'scheduledAt': scheduledAt, }; final Map apiHeaders = { @@ -273,7 +273,7 @@ class Messaging extends Service { if (users != null) 'users': users, if (targets != null) 'targets': targets, if (draft != null) 'draft': draft, - if (scheduledAt != null) 'scheduledAt': scheduledAt, + 'scheduledAt': scheduledAt, }; final Map apiHeaders = { @@ -304,12 +304,12 @@ class Messaging extends Service { .replaceAll('{messageId}', messageId); final Map apiParams = { - if (topics != null) 'topics': topics, - if (users != null) 'users': users, - if (targets != null) 'targets': targets, - if (content != null) 'content': content, - if (draft != null) 'draft': draft, - if (scheduledAt != null) 'scheduledAt': scheduledAt, + 'topics': topics, + 'users': users, + 'targets': targets, + 'content': content, + 'draft': draft, + 'scheduledAt': scheduledAt, }; final Map apiHeaders = { @@ -338,12 +338,12 @@ class Messaging extends Service { .replaceAll('{messageId}', messageId); final Map apiParams = { - if (topics != null) 'topics': topics, - if (users != null) 'users': users, - if (targets != null) 'targets': targets, - if (content != null) 'content': content, - if (draft != null) 'draft': draft, - if (scheduledAt != null) 'scheduledAt': scheduledAt, + 'topics': topics, + 'users': users, + 'targets': targets, + 'content': content, + 'draft': draft, + 'scheduledAt': scheduledAt, }; final Map apiHeaders = { @@ -469,7 +469,7 @@ class Messaging extends Service { if (teamId != null) 'teamId': teamId, if (bundleId != null) 'bundleId': bundleId, if (sandbox != null) 'sandbox': sandbox, - if (enabled != null) 'enabled': enabled, + 'enabled': enabled, }; final Map apiHeaders = { @@ -502,7 +502,7 @@ class Messaging extends Service { if (teamId != null) 'teamId': teamId, if (bundleId != null) 'bundleId': bundleId, if (sandbox != null) 'sandbox': sandbox, - if (enabled != null) 'enabled': enabled, + 'enabled': enabled, }; final Map apiHeaders = { @@ -532,12 +532,12 @@ class Messaging extends Service { final Map apiParams = { if (name != null) 'name': name, - if (enabled != null) 'enabled': enabled, + 'enabled': enabled, if (authKey != null) 'authKey': authKey, if (authKeyId != null) 'authKeyId': authKeyId, if (teamId != null) 'teamId': teamId, if (bundleId != null) 'bundleId': bundleId, - if (sandbox != null) 'sandbox': sandbox, + 'sandbox': sandbox, }; final Map apiHeaders = { @@ -565,12 +565,12 @@ class Messaging extends Service { final Map apiParams = { if (name != null) 'name': name, - if (enabled != null) 'enabled': enabled, + 'enabled': enabled, if (authKey != null) 'authKey': authKey, if (authKeyId != null) 'authKeyId': authKeyId, if (teamId != null) 'teamId': teamId, if (bundleId != null) 'bundleId': bundleId, - if (sandbox != null) 'sandbox': sandbox, + 'sandbox': sandbox, }; final Map apiHeaders = { @@ -596,8 +596,8 @@ class Messaging extends Service { final Map apiParams = { 'providerId': providerId, 'name': name, - if (serviceAccountJSON != null) 'serviceAccountJSON': serviceAccountJSON, - if (enabled != null) 'enabled': enabled, + 'serviceAccountJSON': serviceAccountJSON, + 'enabled': enabled, }; final Map apiHeaders = { @@ -621,8 +621,8 @@ class Messaging extends Service { final Map apiParams = { 'providerId': providerId, 'name': name, - if (serviceAccountJSON != null) 'serviceAccountJSON': serviceAccountJSON, - if (enabled != null) 'enabled': enabled, + 'serviceAccountJSON': serviceAccountJSON, + 'enabled': enabled, }; final Map apiHeaders = { @@ -648,8 +648,8 @@ class Messaging extends Service { final Map apiParams = { if (name != null) 'name': name, - if (enabled != null) 'enabled': enabled, - if (serviceAccountJSON != null) 'serviceAccountJSON': serviceAccountJSON, + 'enabled': enabled, + 'serviceAccountJSON': serviceAccountJSON, }; final Map apiHeaders = { @@ -673,8 +673,8 @@ class Messaging extends Service { final Map apiParams = { if (name != null) 'name': name, - if (enabled != null) 'enabled': enabled, - if (serviceAccountJSON != null) 'serviceAccountJSON': serviceAccountJSON, + 'enabled': enabled, + 'serviceAccountJSON': serviceAccountJSON, }; final Map apiHeaders = { @@ -706,12 +706,12 @@ class Messaging extends Service { 'name': name, if (apiKey != null) 'apiKey': apiKey, if (domain != null) 'domain': domain, - if (isEuRegion != null) 'isEuRegion': isEuRegion, + 'isEuRegion': isEuRegion, if (fromName != null) 'fromName': fromName, if (fromEmail != null) 'fromEmail': fromEmail, if (replyToName != null) 'replyToName': replyToName, if (replyToEmail != null) 'replyToEmail': replyToEmail, - if (enabled != null) 'enabled': enabled, + 'enabled': enabled, }; final Map apiHeaders = { @@ -743,8 +743,8 @@ class Messaging extends Service { if (name != null) 'name': name, if (apiKey != null) 'apiKey': apiKey, if (domain != null) 'domain': domain, - if (isEuRegion != null) 'isEuRegion': isEuRegion, - if (enabled != null) 'enabled': enabled, + 'isEuRegion': isEuRegion, + 'enabled': enabled, if (fromName != null) 'fromName': fromName, if (fromEmail != null) 'fromEmail': fromEmail, if (replyToName != null) 'replyToName': replyToName, @@ -777,7 +777,7 @@ class Messaging extends Service { if (templateId != null) 'templateId': templateId, if (senderId != null) 'senderId': senderId, if (authKey != null) 'authKey': authKey, - if (enabled != null) 'enabled': enabled, + 'enabled': enabled, }; final Map apiHeaders = { @@ -803,7 +803,7 @@ class Messaging extends Service { final Map apiParams = { if (name != null) 'name': name, - if (enabled != null) 'enabled': enabled, + 'enabled': enabled, if (templateId != null) 'templateId': templateId, if (senderId != null) 'senderId': senderId, if (authKey != null) 'authKey': authKey, @@ -839,7 +839,7 @@ class Messaging extends Service { if (fromEmail != null) 'fromEmail': fromEmail, if (replyToName != null) 'replyToName': replyToName, if (replyToEmail != null) 'replyToEmail': replyToEmail, - if (enabled != null) 'enabled': enabled, + 'enabled': enabled, }; final Map apiHeaders = { @@ -867,7 +867,7 @@ class Messaging extends Service { final Map apiParams = { if (name != null) 'name': name, - if (enabled != null) 'enabled': enabled, + 'enabled': enabled, if (apiKey != null) 'apiKey': apiKey, if (fromName != null) 'fromName': fromName, if (fromEmail != null) 'fromEmail': fromEmail, @@ -905,7 +905,7 @@ class Messaging extends Service { if (fromEmail != null) 'fromEmail': fromEmail, if (replyToName != null) 'replyToName': replyToName, if (replyToEmail != null) 'replyToEmail': replyToEmail, - if (enabled != null) 'enabled': enabled, + 'enabled': enabled, }; final Map apiHeaders = { @@ -933,7 +933,7 @@ class Messaging extends Service { final Map apiParams = { if (name != null) 'name': name, - if (enabled != null) 'enabled': enabled, + 'enabled': enabled, if (apiKey != null) 'apiKey': apiKey, if (fromName != null) 'fromName': fromName, if (fromEmail != null) 'fromEmail': fromEmail, @@ -985,7 +985,7 @@ class Messaging extends Service { if (fromEmail != null) 'fromEmail': fromEmail, if (replyToName != null) 'replyToName': replyToName, if (replyToEmail != null) 'replyToEmail': replyToEmail, - if (enabled != null) 'enabled': enabled, + 'enabled': enabled, }; final Map apiHeaders = { @@ -1030,7 +1030,7 @@ class Messaging extends Service { if (fromEmail != null) 'fromEmail': fromEmail, if (replyToName != null) 'replyToName': replyToName, if (replyToEmail != null) 'replyToEmail': replyToEmail, - if (enabled != null) 'enabled': enabled, + 'enabled': enabled, }; final Map apiHeaders = { @@ -1067,17 +1067,17 @@ class Messaging extends Service { final Map apiParams = { if (name != null) 'name': name, if (host != null) 'host': host, - if (port != null) 'port': port, + 'port': port, if (username != null) 'username': username, if (password != null) 'password': password, if (encryption != null) 'encryption': encryption!.value, - if (autoTLS != null) 'autoTLS': autoTLS, + 'autoTLS': autoTLS, if (mailer != null) 'mailer': mailer, if (fromName != null) 'fromName': fromName, if (fromEmail != null) 'fromEmail': fromEmail, if (replyToName != null) 'replyToName': replyToName, if (replyToEmail != null) 'replyToEmail': replyToEmail, - if (enabled != null) 'enabled': enabled, + 'enabled': enabled, }; final Map apiHeaders = { @@ -1112,17 +1112,17 @@ class Messaging extends Service { final Map apiParams = { if (name != null) 'name': name, if (host != null) 'host': host, - if (port != null) 'port': port, + 'port': port, if (username != null) 'username': username, if (password != null) 'password': password, if (encryption != null) 'encryption': encryption!.value, - if (autoTLS != null) 'autoTLS': autoTLS, + 'autoTLS': autoTLS, if (mailer != null) 'mailer': mailer, if (fromName != null) 'fromName': fromName, if (fromEmail != null) 'fromEmail': fromEmail, if (replyToName != null) 'replyToName': replyToName, if (replyToEmail != null) 'replyToEmail': replyToEmail, - if (enabled != null) 'enabled': enabled, + 'enabled': enabled, }; final Map apiHeaders = { @@ -1151,7 +1151,7 @@ class Messaging extends Service { if (from != null) 'from': from, if (customerId != null) 'customerId': customerId, if (apiKey != null) 'apiKey': apiKey, - if (enabled != null) 'enabled': enabled, + 'enabled': enabled, }; final Map apiHeaders = { @@ -1177,7 +1177,7 @@ class Messaging extends Service { final Map apiParams = { if (name != null) 'name': name, - if (enabled != null) 'enabled': enabled, + 'enabled': enabled, if (customerId != null) 'customerId': customerId, if (apiKey != null) 'apiKey': apiKey, if (from != null) 'from': from, @@ -1209,7 +1209,7 @@ class Messaging extends Service { if (from != null) 'from': from, if (username != null) 'username': username, if (apiKey != null) 'apiKey': apiKey, - if (enabled != null) 'enabled': enabled, + 'enabled': enabled, }; final Map apiHeaders = { @@ -1235,7 +1235,7 @@ class Messaging extends Service { final Map apiParams = { if (name != null) 'name': name, - if (enabled != null) 'enabled': enabled, + 'enabled': enabled, if (username != null) 'username': username, if (apiKey != null) 'apiKey': apiKey, if (from != null) 'from': from, @@ -1267,7 +1267,7 @@ class Messaging extends Service { if (from != null) 'from': from, if (accountSid != null) 'accountSid': accountSid, if (authToken != null) 'authToken': authToken, - if (enabled != null) 'enabled': enabled, + 'enabled': enabled, }; final Map apiHeaders = { @@ -1293,7 +1293,7 @@ class Messaging extends Service { final Map apiParams = { if (name != null) 'name': name, - if (enabled != null) 'enabled': enabled, + 'enabled': enabled, if (accountSid != null) 'accountSid': accountSid, if (authToken != null) 'authToken': authToken, if (from != null) 'from': from, @@ -1325,7 +1325,7 @@ class Messaging extends Service { if (from != null) 'from': from, if (apiKey != null) 'apiKey': apiKey, if (apiSecret != null) 'apiSecret': apiSecret, - if (enabled != null) 'enabled': enabled, + 'enabled': enabled, }; final Map apiHeaders = { @@ -1351,7 +1351,7 @@ class Messaging extends Service { final Map apiParams = { if (name != null) 'name': name, - if (enabled != null) 'enabled': enabled, + 'enabled': enabled, if (apiKey != null) 'apiKey': apiKey, if (apiSecret != null) 'apiSecret': apiSecret, if (from != null) 'from': from, @@ -1506,8 +1506,8 @@ class Messaging extends Service { '/messaging/topics/{topicId}'.replaceAll('{topicId}', topicId); final Map apiParams = { - if (name != null) 'name': name, - if (subscribe != null) 'subscribe': subscribe, + 'name': name, + 'subscribe': subscribe, }; final Map apiHeaders = { diff --git a/lib/services/sites.dart b/lib/services/sites.dart index c2fa9383..4582b794 100644 --- a/lib/services/sites.dart +++ b/lib/services/sites.dart @@ -311,7 +311,8 @@ class Sites extends Service { required String repository, required String owner, required String rootDirectory, - required String version, + required enums.TemplateReferenceType type, + required String reference, bool? activate}) async { final String apiPath = '/sites/{siteId}/deployments/template'.replaceAll('{siteId}', siteId); @@ -320,7 +321,8 @@ class Sites extends Service { 'repository': repository, 'owner': owner, 'rootDirectory': rootDirectory, - 'version': version, + 'type': type.value, + 'reference': reference, if (activate != null) 'activate': activate, }; @@ -339,7 +341,7 @@ class Sites extends Service { /// This endpoint lets you create deployment from a branch, commit, or a tag. Future createVcsDeployment( {required String siteId, - required enums.VCSDeploymentType type, + required enums.VCSReferenceType type, required String reference, bool? activate}) async { final String apiPath = @@ -568,8 +570,8 @@ class Sites extends Service { final Map apiParams = { 'key': key, - if (value != null) 'value': value, - if (secret != null) 'secret': secret, + 'value': value, + 'secret': secret, }; final Map apiHeaders = { diff --git a/lib/services/storage.dart b/lib/services/storage.dart index e40666b4..2256b623 100644 --- a/lib/services/storage.dart +++ b/lib/services/storage.dart @@ -35,13 +35,14 @@ class Storage extends Service { List? allowedFileExtensions, enums.Compression? compression, bool? encryption, - bool? antivirus}) async { + bool? antivirus, + bool? transformations}) async { final String apiPath = '/storage/buckets'; final Map apiParams = { 'bucketId': bucketId, 'name': name, - if (permissions != null) 'permissions': permissions, + 'permissions': permissions, if (fileSecurity != null) 'fileSecurity': fileSecurity, if (enabled != null) 'enabled': enabled, if (maximumFileSize != null) 'maximumFileSize': maximumFileSize, @@ -50,6 +51,7 @@ class Storage extends Service { if (compression != null) 'compression': compression!.value, if (encryption != null) 'encryption': encryption, if (antivirus != null) 'antivirus': antivirus, + if (transformations != null) 'transformations': transformations, }; final Map apiHeaders = { @@ -89,13 +91,14 @@ class Storage extends Service { List? allowedFileExtensions, enums.Compression? compression, bool? encryption, - bool? antivirus}) async { + bool? antivirus, + bool? transformations}) async { final String apiPath = '/storage/buckets/{bucketId}'.replaceAll('{bucketId}', bucketId); final Map apiParams = { 'name': name, - if (permissions != null) 'permissions': permissions, + 'permissions': permissions, if (fileSecurity != null) 'fileSecurity': fileSecurity, if (enabled != null) 'enabled': enabled, if (maximumFileSize != null) 'maximumFileSize': maximumFileSize, @@ -104,6 +107,7 @@ class Storage extends Service { if (compression != null) 'compression': compression!.value, if (encryption != null) 'encryption': encryption, if (antivirus != null) 'antivirus': antivirus, + if (transformations != null) 'transformations': transformations, }; final Map apiHeaders = { @@ -239,8 +243,8 @@ class Storage extends Service { .replaceAll('{fileId}', fileId); final Map apiParams = { - if (name != null) 'name': name, - if (permissions != null) 'permissions': permissions, + 'name': name, + 'permissions': permissions, }; final Map apiHeaders = { diff --git a/lib/services/tables_db.dart b/lib/services/tables_db.dart index 78391bf0..7f669447 100644 --- a/lib/services/tables_db.dart +++ b/lib/services/tables_db.dart @@ -250,7 +250,7 @@ class TablesDB extends Service { final Map apiParams = { 'tableId': tableId, 'name': name, - if (permissions != null) 'permissions': permissions, + 'permissions': permissions, if (rowSecurity != null) 'rowSecurity': rowSecurity, if (enabled != null) 'enabled': enabled, }; @@ -297,7 +297,7 @@ class TablesDB extends Service { final Map apiParams = { 'name': name, - if (permissions != null) 'permissions': permissions, + 'permissions': permissions, if (rowSecurity != null) 'rowSecurity': rowSecurity, if (enabled != null) 'enabled': enabled, }; @@ -372,7 +372,7 @@ class TablesDB extends Service { final Map apiParams = { 'key': key, 'required': xrequired, - if (xdefault != null) 'default': xdefault, + 'default': xdefault, if (array != null) 'array': array, }; @@ -404,7 +404,7 @@ class TablesDB extends Service { final Map apiParams = { 'required': xrequired, 'default': xdefault, - if (newKey != null) 'newKey': newKey, + 'newKey': newKey, }; final Map apiHeaders = { @@ -433,7 +433,7 @@ class TablesDB extends Service { final Map apiParams = { 'key': key, 'required': xrequired, - if (xdefault != null) 'default': xdefault, + 'default': xdefault, if (array != null) 'array': array, }; @@ -465,7 +465,7 @@ class TablesDB extends Service { final Map apiParams = { 'required': xrequired, 'default': xdefault, - if (newKey != null) 'newKey': newKey, + 'newKey': newKey, }; final Map apiHeaders = { @@ -495,7 +495,7 @@ class TablesDB extends Service { final Map apiParams = { 'key': key, 'required': xrequired, - if (xdefault != null) 'default': xdefault, + 'default': xdefault, if (array != null) 'array': array, }; @@ -528,7 +528,7 @@ class TablesDB extends Service { final Map apiParams = { 'required': xrequired, 'default': xdefault, - if (newKey != null) 'newKey': newKey, + 'newKey': newKey, }; final Map apiHeaders = { @@ -560,7 +560,7 @@ class TablesDB extends Service { 'key': key, 'elements': elements, 'required': xrequired, - if (xdefault != null) 'default': xdefault, + 'default': xdefault, if (array != null) 'array': array, }; @@ -595,7 +595,7 @@ class TablesDB extends Service { 'elements': elements, 'required': xrequired, 'default': xdefault, - if (newKey != null) 'newKey': newKey, + 'newKey': newKey, }; final Map apiHeaders = { @@ -628,9 +628,9 @@ class TablesDB extends Service { final Map apiParams = { 'key': key, 'required': xrequired, - if (min != null) 'min': min, - if (max != null) 'max': max, - if (xdefault != null) 'default': xdefault, + 'min': min, + 'max': max, + 'default': xdefault, if (array != null) 'array': array, }; @@ -664,10 +664,10 @@ class TablesDB extends Service { final Map apiParams = { 'required': xrequired, - if (min != null) 'min': min, - if (max != null) 'max': max, + 'min': min, + 'max': max, 'default': xdefault, - if (newKey != null) 'newKey': newKey, + 'newKey': newKey, }; final Map apiHeaders = { @@ -700,9 +700,9 @@ class TablesDB extends Service { final Map apiParams = { 'key': key, 'required': xrequired, - if (min != null) 'min': min, - if (max != null) 'max': max, - if (xdefault != null) 'default': xdefault, + 'min': min, + 'max': max, + 'default': xdefault, if (array != null) 'array': array, }; @@ -736,10 +736,10 @@ class TablesDB extends Service { final Map apiParams = { 'required': xrequired, - if (min != null) 'min': min, - if (max != null) 'max': max, + 'min': min, + 'max': max, 'default': xdefault, - if (newKey != null) 'newKey': newKey, + 'newKey': newKey, }; final Map apiHeaders = { @@ -768,7 +768,7 @@ class TablesDB extends Service { final Map apiParams = { 'key': key, 'required': xrequired, - if (xdefault != null) 'default': xdefault, + 'default': xdefault, if (array != null) 'array': array, }; @@ -801,7 +801,7 @@ class TablesDB extends Service { final Map apiParams = { 'required': xrequired, 'default': xdefault, - if (newKey != null) 'newKey': newKey, + 'newKey': newKey, }; final Map apiHeaders = { @@ -860,7 +860,7 @@ class TablesDB extends Service { final Map apiParams = { 'required': xrequired, 'default': xdefault, - if (newKey != null) 'newKey': newKey, + 'newKey': newKey, }; final Map apiHeaders = { @@ -919,7 +919,7 @@ class TablesDB extends Service { final Map apiParams = { 'required': xrequired, 'default': xdefault, - if (newKey != null) 'newKey': newKey, + 'newKey': newKey, }; final Map apiHeaders = { @@ -978,7 +978,7 @@ class TablesDB extends Service { final Map apiParams = { 'required': xrequired, 'default': xdefault, - if (newKey != null) 'newKey': newKey, + 'newKey': newKey, }; final Map apiHeaders = { @@ -1012,8 +1012,8 @@ class TablesDB extends Service { 'relatedTableId': relatedTableId, 'type': type.value, if (twoWay != null) 'twoWay': twoWay, - if (key != null) 'key': key, - if (twoWayKey != null) 'twoWayKey': twoWayKey, + 'key': key, + 'twoWayKey': twoWayKey, if (onDelete != null) 'onDelete': onDelete!.value, }; @@ -1047,7 +1047,7 @@ class TablesDB extends Service { 'key': key, 'size': size, 'required': xrequired, - if (xdefault != null) 'default': xdefault, + 'default': xdefault, if (array != null) 'array': array, if (encrypt != null) 'encrypt': encrypt, }; @@ -1082,8 +1082,8 @@ class TablesDB extends Service { final Map apiParams = { 'required': xrequired, 'default': xdefault, - if (size != null) 'size': size, - if (newKey != null) 'newKey': newKey, + 'size': size, + 'newKey': newKey, }; final Map apiHeaders = { @@ -1112,7 +1112,7 @@ class TablesDB extends Service { final Map apiParams = { 'key': key, 'required': xrequired, - if (xdefault != null) 'default': xdefault, + 'default': xdefault, if (array != null) 'array': array, }; @@ -1145,7 +1145,7 @@ class TablesDB extends Service { final Map apiParams = { 'required': xrequired, 'default': xdefault, - if (newKey != null) 'newKey': newKey, + 'newKey': newKey, }; final Map apiHeaders = { @@ -1218,8 +1218,8 @@ class TablesDB extends Service { .replaceAll('{key}', key); final Map apiParams = { - if (onDelete != null) 'onDelete': onDelete!.value, - if (newKey != null) 'newKey': newKey, + 'onDelete': onDelete?.value, + 'newKey': newKey, }; final Map apiHeaders = { @@ -1376,8 +1376,8 @@ class TablesDB extends Service { final Map apiParams = { 'rowId': rowId, 'data': data, - if (permissions != null) 'permissions': permissions, - if (transactionId != null) 'transactionId': transactionId, + 'permissions': permissions, + 'transactionId': transactionId, }; final Map apiHeaders = { @@ -1405,7 +1405,7 @@ class TablesDB extends Service { final Map apiParams = { 'rows': rows, - if (transactionId != null) 'transactionId': transactionId, + 'transactionId': transactionId, }; final Map apiHeaders = { @@ -1434,7 +1434,7 @@ class TablesDB extends Service { final Map apiParams = { 'rows': rows, - if (transactionId != null) 'transactionId': transactionId, + 'transactionId': transactionId, }; final Map apiHeaders = { @@ -1462,7 +1462,7 @@ class TablesDB extends Service { final Map apiParams = { if (data != null) 'data': data, if (queries != null) 'queries': queries, - if (transactionId != null) 'transactionId': transactionId, + 'transactionId': transactionId, }; final Map apiHeaders = { @@ -1488,7 +1488,7 @@ class TablesDB extends Service { final Map apiParams = { if (queries != null) 'queries': queries, - if (transactionId != null) 'transactionId': transactionId, + 'transactionId': transactionId, }; final Map apiHeaders = { @@ -1547,8 +1547,8 @@ class TablesDB extends Service { final Map apiParams = { if (data != null) 'data': data, - if (permissions != null) 'permissions': permissions, - if (transactionId != null) 'transactionId': transactionId, + 'permissions': permissions, + 'transactionId': transactionId, }; final Map apiHeaders = { @@ -1578,8 +1578,8 @@ class TablesDB extends Service { final Map apiParams = { if (data != null) 'data': data, - if (permissions != null) 'permissions': permissions, - if (transactionId != null) 'transactionId': transactionId, + 'permissions': permissions, + 'transactionId': transactionId, }; final Map apiHeaders = { @@ -1605,7 +1605,7 @@ class TablesDB extends Service { .replaceAll('{rowId}', rowId); final Map apiParams = { - if (transactionId != null) 'transactionId': transactionId, + 'transactionId': transactionId, }; final Map apiHeaders = { @@ -1636,8 +1636,8 @@ class TablesDB extends Service { final Map apiParams = { if (value != null) 'value': value, - if (min != null) 'min': min, - if (transactionId != null) 'transactionId': transactionId, + 'min': min, + 'transactionId': transactionId, }; final Map apiHeaders = { @@ -1668,8 +1668,8 @@ class TablesDB extends Service { final Map apiParams = { if (value != null) 'value': value, - if (max != null) 'max': max, - if (transactionId != null) 'transactionId': transactionId, + 'max': max, + 'transactionId': transactionId, }; final Map apiHeaders = { diff --git a/lib/services/users.dart b/lib/services/users.dart index c42fea30..ff9cdd5b 100644 --- a/lib/services/users.dart +++ b/lib/services/users.dart @@ -35,8 +35,8 @@ class Users extends Service { final Map apiParams = { 'userId': userId, - if (email != null) 'email': email, - if (phone != null) 'phone': phone, + 'email': email, + 'phone': phone, if (password != null) 'password': password, if (name != null) 'name': name, }; diff --git a/lib/src/client_browser.dart b/lib/src/client_browser.dart index 3fcf62e1..30e15725 100644 --- a/lib/src/client_browser.dart +++ b/lib/src/client_browser.dart @@ -33,7 +33,7 @@ class ClientBrowser extends ClientBase with ClientMixin { 'x-sdk-name': 'Dart', 'x-sdk-platform': 'server', 'x-sdk-language': 'dart', - 'x-sdk-version': '19.4.0', + 'x-sdk-version': '20.0.0', 'X-Appwrite-Response-Format': '1.8.0', }; diff --git a/lib/src/client_io.dart b/lib/src/client_io.dart index 23114480..9c9af945 100644 --- a/lib/src/client_io.dart +++ b/lib/src/client_io.dart @@ -42,9 +42,9 @@ class ClientIO extends ClientBase with ClientMixin { 'x-sdk-name': 'Dart', 'x-sdk-platform': 'server', 'x-sdk-language': 'dart', - 'x-sdk-version': '19.4.0', + 'x-sdk-version': '20.0.0', 'user-agent': - 'AppwriteDartSDK/19.4.0 (${Platform.operatingSystem}; ${Platform.operatingSystemVersion})', + 'AppwriteDartSDK/20.0.0 (${Platform.operatingSystem}; ${Platform.operatingSystemVersion})', 'X-Appwrite-Response-Format': '1.8.0', }; diff --git a/lib/src/enums/template_reference_type.dart b/lib/src/enums/template_reference_type.dart new file mode 100644 index 00000000..48ee1fad --- /dev/null +++ b/lib/src/enums/template_reference_type.dart @@ -0,0 +1,13 @@ +part of '../../enums.dart'; + +enum TemplateReferenceType { + branch(value: 'branch'), + commit(value: 'commit'), + tag(value: 'tag'); + + const TemplateReferenceType({required this.value}); + + final String value; + + String toJson() => value; +} diff --git a/lib/src/enums/vcs_deployment_type.dart b/lib/src/enums/vcs_reference_type.dart similarity index 67% rename from lib/src/enums/vcs_deployment_type.dart rename to lib/src/enums/vcs_reference_type.dart index f01fcb01..c7e72f1c 100644 --- a/lib/src/enums/vcs_deployment_type.dart +++ b/lib/src/enums/vcs_reference_type.dart @@ -1,11 +1,11 @@ part of '../../enums.dart'; -enum VCSDeploymentType { +enum VCSReferenceType { branch(value: 'branch'), commit(value: 'commit'), tag(value: 'tag'); - const VCSDeploymentType({required this.value}); + const VCSReferenceType({required this.value}); final String value; diff --git a/lib/src/models/bucket.dart b/lib/src/models/bucket.dart index 585a6d1e..197907ad 100644 --- a/lib/src/models/bucket.dart +++ b/lib/src/models/bucket.dart @@ -38,6 +38,9 @@ class Bucket implements Model { /// Virus scanning is enabled. final bool antivirus; + /// Image transformations are enabled. + final bool transformations; + Bucket({ required this.$id, required this.$createdAt, @@ -51,6 +54,7 @@ class Bucket implements Model { required this.compression, required this.encryption, required this.antivirus, + required this.transformations, }); factory Bucket.fromMap(Map map) { @@ -67,6 +71,7 @@ class Bucket implements Model { compression: map['compression'].toString(), encryption: map['encryption'], antivirus: map['antivirus'], + transformations: map['transformations'], ); } @@ -85,6 +90,7 @@ class Bucket implements Model { "compression": compression, "encryption": encryption, "antivirus": antivirus, + "transformations": transformations, }; } } diff --git a/pubspec.yaml b/pubspec.yaml index 07db02a2..30dc7930 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: dart_appwrite -version: 19.4.0 +version: 20.0.0 description: Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API homepage: https://appwrite.io repository: https://github.com/appwrite/sdk-for-dart diff --git a/test/services/functions_test.dart b/test/services/functions_test.dart index 6a1d0870..06961694 100644 --- a/test/services/functions_test.dart +++ b/test/services/functions_test.dart @@ -434,7 +434,8 @@ void main() { repository: '', owner: '', rootDirectory: '', - version: '', + type: enums.TemplateReferenceType.commit, + reference: '', ); expect(response, isA()); }); @@ -479,7 +480,7 @@ void main() { final response = await functions.createVcsDeployment( functionId: '', - type: enums.VCSDeploymentType.branch, + type: enums.VCSReferenceType.branch, reference: '', ); expect(response, isA()); diff --git a/test/services/sites_test.dart b/test/services/sites_test.dart index 597e3789..3afaae3d 100644 --- a/test/services/sites_test.dart +++ b/test/services/sites_test.dart @@ -440,7 +440,8 @@ void main() { repository: '', owner: '', rootDirectory: '', - version: '', + type: enums.TemplateReferenceType.branch, + reference: '', ); expect(response, isA()); }); @@ -485,7 +486,7 @@ void main() { final response = await sites.createVcsDeployment( siteId: '', - type: enums.VCSDeploymentType.branch, + type: enums.VCSReferenceType.branch, reference: '', ); expect(response, isA()); diff --git a/test/services/storage_test.dart b/test/services/storage_test.dart index 6452346e..36c13f90 100644 --- a/test/services/storage_test.dart +++ b/test/services/storage_test.dart @@ -82,6 +82,7 @@ void main() { 'compression': 'gzip', 'encryption': true, 'antivirus': true, + 'transformations': true, }; when(client.call( @@ -109,6 +110,7 @@ void main() { 'compression': 'gzip', 'encryption': true, 'antivirus': true, + 'transformations': true, }; when(client.call( @@ -135,6 +137,7 @@ void main() { 'compression': 'gzip', 'encryption': true, 'antivirus': true, + 'transformations': true, }; when(client.call( diff --git a/test/src/models/bucket_test.dart b/test/src/models/bucket_test.dart index 143eeb19..15240def 100644 --- a/test/src/models/bucket_test.dart +++ b/test/src/models/bucket_test.dart @@ -17,6 +17,7 @@ void main() { compression: 'gzip', encryption: true, antivirus: true, + transformations: true, ); final map = model.toMap(); @@ -34,6 +35,7 @@ void main() { expect(result.compression, 'gzip'); expect(result.encryption, true); expect(result.antivirus, true); + expect(result.transformations, true); }); }); }