appwrite-cli 8.0.1 → 8.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/install.ps1 +2 -2
- package/install.sh +1 -1
- package/lib/client.js +2 -2
- package/lib/parser.js +1 -1
- package/lib/type-generation/languages/dart.js +2 -2
- package/lib/type-generation/languages/java.js +2 -2
- package/lib/type-generation/languages/kotlin.js +1 -1
- package/lib/type-generation/languages/swift.js +7 -1
- package/package.json +1 -1
- package/scoop/appwrite.json +3 -3
package/README.md
CHANGED
|
@@ -29,7 +29,7 @@ Once the installation is complete, you can verify the install using
|
|
|
29
29
|
|
|
30
30
|
```sh
|
|
31
31
|
$ appwrite -v
|
|
32
|
-
8.0.
|
|
32
|
+
8.0.2
|
|
33
33
|
```
|
|
34
34
|
|
|
35
35
|
### Install using prebuilt binaries
|
|
@@ -60,7 +60,7 @@ $ scoop install https://raw.githubusercontent.com/appwrite/sdk-for-cli/master/sc
|
|
|
60
60
|
Once the installation completes, you can verify your install using
|
|
61
61
|
```
|
|
62
62
|
$ appwrite -v
|
|
63
|
-
8.0.
|
|
63
|
+
8.0.2
|
|
64
64
|
```
|
|
65
65
|
|
|
66
66
|
## Getting Started
|
package/install.ps1
CHANGED
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
# You can use "View source" of this page to see the full script.
|
|
14
14
|
|
|
15
15
|
# REPO
|
|
16
|
-
$GITHUB_x64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/8.0.
|
|
17
|
-
$GITHUB_arm64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/8.0.
|
|
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"
|
|
18
18
|
|
|
19
19
|
$APPWRITE_BINARY_NAME = "appwrite.exe"
|
|
20
20
|
|
package/install.sh
CHANGED
|
@@ -97,7 +97,7 @@ printSuccess() {
|
|
|
97
97
|
downloadBinary() {
|
|
98
98
|
echo "[2/4] Downloading executable for $OS ($ARCH) ..."
|
|
99
99
|
|
|
100
|
-
GITHUB_LATEST_VERSION="8.0.
|
|
100
|
+
GITHUB_LATEST_VERSION="8.0.2"
|
|
101
101
|
GITHUB_FILE="appwrite-cli-${OS}-${ARCH}"
|
|
102
102
|
GITHUB_URL="https://github.com/$GITHUB_REPOSITORY_NAME/releases/download/$GITHUB_LATEST_VERSION/$GITHUB_FILE"
|
|
103
103
|
|
package/lib/client.js
CHANGED
|
@@ -16,8 +16,8 @@ class Client {
|
|
|
16
16
|
'x-sdk-name': 'Command Line',
|
|
17
17
|
'x-sdk-platform': 'console',
|
|
18
18
|
'x-sdk-language': 'cli',
|
|
19
|
-
'x-sdk-version': '8.0.
|
|
20
|
-
'user-agent' : `AppwriteCLI/8.0.
|
|
19
|
+
'x-sdk-version': '8.0.2',
|
|
20
|
+
'user-agent' : `AppwriteCLI/8.0.2 (${os.type()} ${os.version()}; ${os.arch()})`,
|
|
21
21
|
'X-Appwrite-Response-Format' : '1.7.0',
|
|
22
22
|
};
|
|
23
23
|
}
|
package/lib/parser.js
CHANGED
|
@@ -120,7 +120,7 @@ const parseError = (err) => {
|
|
|
120
120
|
} catch {
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
-
const version = '8.0.
|
|
123
|
+
const version = '8.0.2';
|
|
124
124
|
const stepsToReproduce = `Running \`appwrite ${cliConfig.reportData.data.args.join(' ')}\``;
|
|
125
125
|
const yourEnvironment = `CLI version: ${version}\nOperation System: ${os.type()}\nAppwrite version: ${appwriteVersion}\nIs Cloud: ${isCloud}`;
|
|
126
126
|
|
|
@@ -52,7 +52,7 @@ import '<%- attribute.relatedCollection.toLowerCase() %>.dart';
|
|
|
52
52
|
<% if (attribute.format === 'enum') { -%>
|
|
53
53
|
enum <%- toPascalCase(attribute.key) %> {
|
|
54
54
|
<% for (const element of attribute.elements) { -%>
|
|
55
|
-
<%- element %>,
|
|
55
|
+
<%- toSnakeCase(element) %>,
|
|
56
56
|
<% } -%>
|
|
57
57
|
}
|
|
58
58
|
|
|
@@ -78,7 +78,7 @@ class <%= toPascalCase(collection.name) %> {
|
|
|
78
78
|
(map['<%= attribute.key %>'] as List<dynamic>?)?.map((e) => <%- toPascalCase(attribute.key) %>.values.firstWhere((element) => element.name == e)).toList()<% if (!attribute.required) { %> ?? []<% } -%>
|
|
79
79
|
<% } else { -%>
|
|
80
80
|
<% 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 { -%>
|
|
82
82
|
<%- toPascalCase(attribute.key) %>.values.firstWhere((e) => e.name == map['<%= attribute.key %>'])<% } -%>
|
|
83
83
|
<% } -%>
|
|
84
84
|
<% } else { -%>
|
|
@@ -44,7 +44,7 @@ class Java extends LanguageMeta {
|
|
|
44
44
|
import java.util.*;
|
|
45
45
|
<% for (const attribute of collection.attributes) { -%>
|
|
46
46
|
<% if (attribute.type === 'relationship') { -%>
|
|
47
|
-
import
|
|
47
|
+
import io.appwrite.models.<%- toPascalCase(attribute.relatedCollection) %>;
|
|
48
48
|
|
|
49
49
|
<% } -%>
|
|
50
50
|
<% } -%>
|
|
@@ -54,7 +54,7 @@ public class <%- toPascalCase(collection.name) %> {
|
|
|
54
54
|
|
|
55
55
|
public enum <%- toPascalCase(attribute.key) %> {
|
|
56
56
|
<% for (const [index, element] of Object.entries(attribute.elements)) { -%>
|
|
57
|
-
<%- element %><%- index < attribute.elements.length - 1 ? ',' : ';' %>
|
|
57
|
+
<%- toSnakeCase(element) %><%- index < attribute.elements.length - 1 ? ',' : ';' %>
|
|
58
58
|
<% } -%>
|
|
59
59
|
}
|
|
60
60
|
|
|
@@ -54,7 +54,7 @@ import <%- toPascalCase(attribute.relatedCollection) %>
|
|
|
54
54
|
<% if (attribute.format === 'enum') { -%>
|
|
55
55
|
enum class <%- toPascalCase(attribute.key) %> {
|
|
56
56
|
<% for (const [index, element] of Object.entries(attribute.elements)) { -%>
|
|
57
|
-
<%- element %><%- index < attribute.elements.length - 1 ? ',' : '' %>
|
|
57
|
+
<%- toUpperSnakeCase(element) %><%- index < attribute.elements.length - 1 ? ',' : '' %>
|
|
58
58
|
<% } -%>
|
|
59
59
|
}
|
|
60
60
|
|
|
@@ -116,7 +116,11 @@ public class <%- toPascalCase(collection.name) %>: Codable {
|
|
|
116
116
|
return <%- toPascalCase(collection.name) %>(
|
|
117
117
|
<% for (const attribute of collection.attributes) { -%>
|
|
118
118
|
<% 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 { -%>
|
|
119
122
|
<%- toCamelCase(attribute.key) %>: map["<%- attribute.key %>"] as<% if (!attribute.required) { %>?<% } else { %>!<% } %> <%- toPascalCase(attribute.relatedCollection) %><% if (attribute !== collection.attributes[collection.attributes.length - 1]) { %>,<% } %>
|
|
123
|
+
<% } -%>
|
|
120
124
|
<% } else if (attribute.array) { -%>
|
|
121
125
|
<% if (attribute.type === 'string') { -%>
|
|
122
126
|
<%- 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 {
|
|
|
130
134
|
<%- 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]) { %>,<% } %>
|
|
131
135
|
<% } -%>
|
|
132
136
|
<% } else { -%>
|
|
133
|
-
<% if (attribute.type === 'string' || attribute.type === 'email' || attribute.type === 'datetime'
|
|
137
|
+
<% if ((attribute.type === 'string' || attribute.type === 'email' || attribute.type === 'datetime') && attribute.format !== 'enum') { -%>
|
|
134
138
|
<%- 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]) { %>,<% } %>
|
|
135
141
|
<% } else if (attribute.type === 'integer') { -%>
|
|
136
142
|
<%- toCamelCase(attribute.key) %>: map["<%- attribute.key %>"] as<% if (!attribute.required) { %>?<% } else { %>!<% } %> Int<% if (attribute !== collection.attributes[collection.attributes.length - 1]) { %>,<% } %>
|
|
137
143
|
<% } else if (attribute.type === 'float') { -%>
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "appwrite-cli",
|
|
3
3
|
"homepage": "https://appwrite.io/support",
|
|
4
4
|
"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.
|
|
5
|
+
"version": "8.0.2",
|
|
6
6
|
"license": "BSD-3-Clause",
|
|
7
7
|
"main": "index.js",
|
|
8
8
|
"bin": {
|
package/scoop/appwrite.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://raw.githubusercontent.com/ScoopInstaller/Scoop/master/schema.json",
|
|
3
|
-
"version": "8.0.
|
|
3
|
+
"version": "8.0.2",
|
|
4
4
|
"description": "The Appwrite CLI is a command-line application that allows you to interact with Appwrite and perform server-side tasks using your terminal.",
|
|
5
5
|
"homepage": "https://github.com/appwrite/sdk-for-cli",
|
|
6
6
|
"license": "BSD-3-Clause",
|
|
7
7
|
"architecture": {
|
|
8
8
|
"64bit": {
|
|
9
|
-
"url": "https://github.com/appwrite/sdk-for-cli/releases/download/8.0.
|
|
9
|
+
"url": "https://github.com/appwrite/sdk-for-cli/releases/download/8.0.2/appwrite-cli-win-x64.exe",
|
|
10
10
|
"bin": [
|
|
11
11
|
[
|
|
12
12
|
"appwrite-cli-win-x64.exe",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
]
|
|
16
16
|
},
|
|
17
17
|
"arm64": {
|
|
18
|
-
"url": "https://github.com/appwrite/sdk-for-cli/releases/download/8.0.
|
|
18
|
+
"url": "https://github.com/appwrite/sdk-for-cli/releases/download/8.0.2/appwrite-cli-win-arm64.exe",
|
|
19
19
|
"bin": [
|
|
20
20
|
[
|
|
21
21
|
"appwrite-cli-win-arm64.exe",
|