Skip to content

Commit 0db17f9

Browse files
committed
chore: regenerate sdk
1 parent 02a5799 commit 0db17f9

File tree

11 files changed

+24
-18
lines changed

11 files changed

+24
-18
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Once the installation is complete, you can verify the install using
2929

3030
```sh
3131
$ appwrite -v
32-
8.0.1
32+
8.0.2
3333
```
3434

3535
### Install using prebuilt binaries
@@ -60,7 +60,7 @@ $ scoop install https://raw.githubusercontent.com/appwrite/sdk-for-cli/master/sc
6060
Once the installation completes, you can verify your install using
6161
```
6262
$ appwrite -v
63-
8.0.1
63+
8.0.2
6464
```
6565

6666
## Getting Started

install.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
# You can use "View source" of this page to see the full script.
1414

1515
# REPO
16-
$GITHUB_x64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/8.0.1/appwrite-cli-win-x64.exe"
17-
$GITHUB_arm64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/8.0.1/appwrite-cli-win-arm64.exe"
16+
$GITHUB_x64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/8.0.2/appwrite-cli-win-x64.exe"
17+
$GITHUB_arm64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/8.0.2/appwrite-cli-win-arm64.exe"
1818

1919
$APPWRITE_BINARY_NAME = "appwrite.exe"
2020

install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ printSuccess() {
9797
downloadBinary() {
9898
echo "[2/4] Downloading executable for $OS ($ARCH) ..."
9999

100-
GITHUB_LATEST_VERSION="8.0.1"
100+
GITHUB_LATEST_VERSION="8.0.2"
101101
GITHUB_FILE="appwrite-cli-${OS}-${ARCH}"
102102
GITHUB_URL="https://github.com/$GITHUB_REPOSITORY_NAME/releases/download/$GITHUB_LATEST_VERSION/$GITHUB_FILE"
103103

lib/client.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ class Client {
1616
'x-sdk-name': 'Command Line',
1717
'x-sdk-platform': 'console',
1818
'x-sdk-language': 'cli',
19-
'x-sdk-version': '8.0.1',
20-
'user-agent' : `AppwriteCLI/8.0.1 (${os.type()} ${os.version()}; ${os.arch()})`,
19+
'x-sdk-version': '8.0.2',
20+
'user-agent' : `AppwriteCLI/8.0.2 (${os.type()} ${os.version()}; ${os.arch()})`,
2121
'X-Appwrite-Response-Format' : '1.7.0',
2222
};
2323
}

lib/parser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ const parseError = (err) => {
120120
} catch {
121121
}
122122

123-
const version = '8.0.1';
123+
const version = '8.0.2';
124124
const stepsToReproduce = `Running \`appwrite ${cliConfig.reportData.data.args.join(' ')}\``;
125125
const yourEnvironment = `CLI version: ${version}\nOperation System: ${os.type()}\nAppwrite version: ${appwriteVersion}\nIs Cloud: ${isCloud}`;
126126

lib/type-generation/languages/dart.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ import '<%- attribute.relatedCollection.toLowerCase() %>.dart';
5252
<% if (attribute.format === 'enum') { -%>
5353
enum <%- toPascalCase(attribute.key) %> {
5454
<% for (const element of attribute.elements) { -%>
55-
<%- element %>,
55+
<%- toSnakeCase(element) %>,
5656
<% } -%>
5757
}
5858
@@ -78,7 +78,7 @@ class <%= toPascalCase(collection.name) %> {
7878
(map['<%= attribute.key %>'] as List<dynamic>?)?.map((e) => <%- toPascalCase(attribute.key) %>.values.firstWhere((element) => element.name == e)).toList()<% if (!attribute.required) { %> ?? []<% } -%>
7979
<% } else { -%>
8080
<% if (!attribute.required) { -%>
81-
map['<%= attribute.key %>'] != null ? <%- toPascalCase(attribute.key) %>.values.where((e) => e.name == map['<%= attribute.key %>']).firstOrNull : null<% } else { -%>
81+
map['<%= attribute.key %>'] != null ? <%- toPascalCase(attribute.key) %>.values.where((e) => e.name == map['<%= attribute.key %>']).firstOrNull() : null<% } else { -%>
8282
<%- toPascalCase(attribute.key) %>.values.firstWhere((e) => e.name == map['<%= attribute.key %>'])<% } -%>
8383
<% } -%>
8484
<% } else { -%>

lib/type-generation/languages/java.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class Java extends LanguageMeta {
4444
import java.util.*;
4545
<% for (const attribute of collection.attributes) { -%>
4646
<% if (attribute.type === 'relationship') { -%>
47-
import <%- toPascalCase(attribute.relatedCollection) %>;
47+
import io.appwrite.models.<%- toPascalCase(attribute.relatedCollection) %>;
4848
4949
<% } -%>
5050
<% } -%>
@@ -54,7 +54,7 @@ public class <%- toPascalCase(collection.name) %> {
5454
5555
public enum <%- toPascalCase(attribute.key) %> {
5656
<% for (const [index, element] of Object.entries(attribute.elements)) { -%>
57-
<%- element %><%- index < attribute.elements.length - 1 ? ',' : ';' %>
57+
<%- toSnakeCase(element) %><%- index < attribute.elements.length - 1 ? ',' : ';' %>
5858
<% } -%>
5959
}
6060

lib/type-generation/languages/kotlin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ import <%- toPascalCase(attribute.relatedCollection) %>
5454
<% if (attribute.format === 'enum') { -%>
5555
enum class <%- toPascalCase(attribute.key) %> {
5656
<% for (const [index, element] of Object.entries(attribute.elements)) { -%>
57-
<%- element %><%- index < attribute.elements.length - 1 ? ',' : '' %>
57+
<%- toUpperSnakeCase(element) %><%- index < attribute.elements.length - 1 ? ',' : '' %>
5858
<% } -%>
5959
}
6060

lib/type-generation/languages/swift.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,11 @@ public class <%- toPascalCase(collection.name) %>: Codable {
116116
return <%- toPascalCase(collection.name) %>(
117117
<% for (const attribute of collection.attributes) { -%>
118118
<% if (attribute.type === 'relationship') { -%>
119+
<% if ((attribute.relationType === 'oneToMany' && attribute.side === 'parent') || (attribute.relationType === 'manyToOne' && attribute.side === 'child') || attribute.relationType === 'manyToMany') { -%>
120+
<%- toCamelCase(attribute.key) %>: map["<%- attribute.key %>"] as<% if (!attribute.required) { %>?<% } else { %>!<% } %> [<%- toPascalCase(attribute.relatedCollection) %>]<% if (attribute !== collection.attributes[collection.attributes.length - 1]) { %>,<% } %>
121+
<% } else { -%>
119122
<%- toCamelCase(attribute.key) %>: map["<%- attribute.key %>"] as<% if (!attribute.required) { %>?<% } else { %>!<% } %> <%- toPascalCase(attribute.relatedCollection) %><% if (attribute !== collection.attributes[collection.attributes.length - 1]) { %>,<% } %>
123+
<% } -%>
120124
<% } else if (attribute.array) { -%>
121125
<% if (attribute.type === 'string') { -%>
122126
<%- toCamelCase(attribute.key) %>: map["<%- attribute.key %>"] as<% if (!attribute.required) { %>?<% } else { %>!<% } %> [String]<% if (attribute !== collection.attributes[collection.attributes.length - 1]) { %>,<% } %>
@@ -130,8 +134,10 @@ public class <%- toPascalCase(collection.name) %>: Codable {
130134
<%- toCamelCase(attribute.key) %>: (map["<%- attribute.key %>"] as<% if (!attribute.required) { %>?<% } else { %>!<% } %> [[String: Any]])<% if (!attribute.required) { %>?<% } %>.map { <%- toPascalCase(attribute.type) %>.from(map: $0) }<% if (attribute !== collection.attributes[collection.attributes.length - 1]) { %>,<% } %>
131135
<% } -%>
132136
<% } else { -%>
133-
<% if (attribute.type === 'string' || attribute.type === 'email' || attribute.type === 'datetime' || attribute.type === 'enum') { -%>
137+
<% if ((attribute.type === 'string' || attribute.type === 'email' || attribute.type === 'datetime') && attribute.format !== 'enum') { -%>
134138
<%- toCamelCase(attribute.key) %>: map["<%- attribute.key %>"] as<% if (!attribute.required) { %>?<% } else { %>!<% } %> String<% if (attribute !== collection.attributes[collection.attributes.length - 1]) { %>,<% } %>
139+
<% } else if (attribute.type === 'string' && attribute.format === 'enum') { -%>
140+
<%- toCamelCase(attribute.key) %>: <%- toPascalCase(attribute.key) %>(rawValue: map["<%- attribute.key %>"] as! String)!<% if (attribute !== collection.attributes[collection.attributes.length - 1]) { %>,<% } %>
135141
<% } else if (attribute.type === 'integer') { -%>
136142
<%- toCamelCase(attribute.key) %>: map["<%- attribute.key %>"] as<% if (!attribute.required) { %>?<% } else { %>!<% } %> Int<% if (attribute !== collection.attributes[collection.attributes.length - 1]) { %>,<% } %>
137143
<% } else if (attribute.type === 'float') { -%>

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "appwrite-cli",
33
"homepage": "https://appwrite.io/support",
44
"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",
5-
"version": "8.0.1",
5+
"version": "8.0.2",
66
"license": "BSD-3-Clause",
77
"main": "index.js",
88
"bin": {

0 commit comments

Comments
 (0)