appwrite-cli 13.2.0 → 13.3.0
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/CHANGELOG.md +9 -0
- package/README.md +2 -2
- package/dist/bundle-win-arm64.mjs +285 -74
- package/dist/cli.cjs +285 -74
- package/dist/index.js +96 -13
- package/dist/lib/commands/config-validations.d.ts +1 -1
- package/dist/lib/commands/config.d.ts +24 -0
- package/dist/lib/commands/config.d.ts.map +1 -1
- package/dist/lib/commands/generic.d.ts +2 -4
- package/dist/lib/commands/generic.d.ts.map +1 -1
- package/dist/lib/commands/push.d.ts.map +1 -1
- package/dist/lib/commands/utils/attributes.d.ts.map +1 -1
- package/dist/lib/constants.d.ts +1 -1
- package/dist/lib/questions.d.ts +1 -0
- package/dist/lib/questions.d.ts.map +1 -1
- package/dist/lib/shared/typescript-type-utils.d.ts.map +1 -1
- package/dist/lib/type-generation/attribute.d.ts +4 -0
- package/dist/lib/type-generation/attribute.d.ts.map +1 -1
- package/dist/lib/type-generation/languages/csharp.d.ts.map +1 -1
- package/dist/lib/type-generation/languages/dart.d.ts.map +1 -1
- package/dist/lib/type-generation/languages/java.d.ts.map +1 -1
- package/dist/lib/type-generation/languages/javascript.d.ts.map +1 -1
- package/dist/lib/type-generation/languages/kotlin.d.ts.map +1 -1
- package/dist/lib/type-generation/languages/php.d.ts.map +1 -1
- package/dist/lib/type-generation/languages/swift.d.ts.map +1 -1
- package/install.ps1 +2 -2
- package/install.sh +1 -1
- package/lib/commands/config-validations.ts +3 -3
- package/lib/commands/config.ts +10 -2
- package/lib/commands/generic.ts +211 -76
- package/lib/commands/push.ts +3 -2
- package/lib/commands/utils/attributes.ts +70 -0
- package/lib/config.ts +4 -4
- package/lib/constants.ts +1 -1
- package/lib/questions.ts +3 -1
- package/lib/shared/typescript-type-utils.ts +4 -0
- package/lib/type-generation/attribute.ts +4 -0
- package/lib/type-generation/languages/csharp.ts +6 -2
- package/lib/type-generation/languages/dart.ts +5 -1
- package/lib/type-generation/languages/java.ts +4 -0
- package/lib/type-generation/languages/javascript.ts +4 -0
- package/lib/type-generation/languages/kotlin.ts +4 -0
- package/lib/type-generation/languages/php.ts +4 -0
- package/lib/type-generation/languages/swift.ts +8 -4
- package/package.json +1 -1
- package/scoop/appwrite.config.json +3 -3
|
@@ -10,6 +10,10 @@ export class Swift extends LanguageMeta {
|
|
|
10
10
|
let type = "";
|
|
11
11
|
switch (attribute.type) {
|
|
12
12
|
case AttributeType.STRING:
|
|
13
|
+
case AttributeType.TEXT:
|
|
14
|
+
case AttributeType.VARCHAR:
|
|
15
|
+
case AttributeType.MEDIUMTEXT:
|
|
16
|
+
case AttributeType.LONGTEXT:
|
|
13
17
|
case AttributeType.DATETIME:
|
|
14
18
|
type = "String";
|
|
15
19
|
if (attribute.format === AttributeType.ENUM) {
|
|
@@ -129,7 +133,7 @@ public class <%- toPascalCase(collection.name) %>: Codable {
|
|
|
129
133
|
<% for (const [index, attribute] of Object.entries(collection.attributes)) { -%>
|
|
130
134
|
<% if (attribute.type === 'relationship') { -%>
|
|
131
135
|
"<%- attribute.key %>": <%- strict ? toCamelCase(attribute.key) : attribute.key %> as Any<% if (index < collection.attributes.length - 1) { %>,<% } %>
|
|
132
|
-
<% } else if (attribute.array &&
|
|
136
|
+
<% } else if (attribute.array && !['string', 'text', 'varchar', 'mediumtext', 'longtext', 'integer', 'float', 'boolean'].includes(attribute.type)) { -%>
|
|
133
137
|
"<%- attribute.key %>": <%- strict ? toCamelCase(attribute.key) : attribute.key %>?.map { $0.toMap() } as Any<% if (index < collection.attributes.length - 1) { %>,<% } %>
|
|
134
138
|
<% } else { -%>
|
|
135
139
|
"<%- attribute.key %>": <%- strict ? toCamelCase(attribute.key) : attribute.key %> as Any<% if (index < collection.attributes.length - 1) { %>,<% } %>
|
|
@@ -145,7 +149,7 @@ public class <%- toPascalCase(collection.name) %>: Codable {
|
|
|
145
149
|
<% const relationshipType = getType(attribute, collections, collection.name).replace('?', ''); -%>
|
|
146
150
|
<%- strict ? toCamelCase(attribute.key) : attribute.key %>: map["<%- attribute.key %>"] as<% if (!attribute.required) { %>?<% } else { %>!<% } %> <%- relationshipType %><% if (index < collection.attributes.length - 1) { %>,<% } %>
|
|
147
151
|
<% } else if (attribute.array) { -%>
|
|
148
|
-
<% if (
|
|
152
|
+
<% if (['string', 'text', 'varchar', 'mediumtext', 'longtext'].includes(attribute.type)) { -%>
|
|
149
153
|
<%- strict ? toCamelCase(attribute.key) : attribute.key %>: map["<%- attribute.key %>"] as<% if (!attribute.required) { %>?<% } else { %>!<% } %> [String]<% if (index < collection.attributes.length - 1) { %>,<% } %>
|
|
150
154
|
<% } else if (attribute.type === 'integer') { -%>
|
|
151
155
|
<%- strict ? toCamelCase(attribute.key) : attribute.key %>: map["<%- attribute.key %>"] as<% if (!attribute.required) { %>?<% } else { %>!<% } %> [Int]<% if (index < collection.attributes.length - 1) { %>,<% } %>
|
|
@@ -157,9 +161,9 @@ public class <%- toPascalCase(collection.name) %>: Codable {
|
|
|
157
161
|
<%- strict ? toCamelCase(attribute.key) : attribute.key %>: (map["<%- attribute.key %>"] as<% if (!attribute.required) { %>?<% } else { %>!<% } %> [[String: Any]])<% if (!attribute.required) { %>?<% } %>.map { <%- toPascalCase(attribute.type) %>.from(map: $0) }<% if (index < collection.attributes.length - 1) { %>,<% } %>
|
|
158
162
|
<% } -%>
|
|
159
163
|
<% } else { -%>
|
|
160
|
-
<% if (
|
|
164
|
+
<% if (['string', 'text', 'varchar', 'mediumtext', 'longtext', 'email', 'datetime'].includes(attribute.type) && attribute.format !== 'enum') { -%>
|
|
161
165
|
<%- strict ? toCamelCase(attribute.key) : attribute.key %>: map["<%- attribute.key %>"] as<% if (!attribute.required) { %>?<% } else { %>!<% } %> String<% if (index < collection.attributes.length - 1) { %>,<% } %>
|
|
162
|
-
<% } else if (
|
|
166
|
+
<% } else if (['string', 'text', 'varchar', 'mediumtext', 'longtext'].includes(attribute.type) && attribute.format === 'enum') { -%>
|
|
163
167
|
<%- strict ? toCamelCase(attribute.key) : attribute.key %>: <%- toPascalCase(collection.name) %><%- toPascalCase(attribute.key) %>(rawValue: map["<%- attribute.key %>"] as! String)!<% if (index < collection.attributes.length - 1) { %>,<% } %>
|
|
164
168
|
<% } else if (attribute.type === 'integer') { -%>
|
|
165
169
|
<%- strict ? toCamelCase(attribute.key) : attribute.key %>: map["<%- attribute.key %>"] as<% if (!attribute.required) { %>?<% } else { %>!<% } %> Int<% if (index < collection.attributes.length - 1) { %>,<% } %>
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"type": "module",
|
|
4
4
|
"homepage": "https://appwrite.io/support",
|
|
5
5
|
"description": "Appwrite is an open-source self-hosted backend server that abstracts and simplifies complex and repetitive development tasks behind a very simple REST API",
|
|
6
|
-
"version": "13.
|
|
6
|
+
"version": "13.3.0",
|
|
7
7
|
"license": "BSD-3-Clause",
|
|
8
8
|
"main": "dist/index.js",
|
|
9
9
|
"types": "dist/index.d.ts",
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://raw.githubusercontent.com/ScoopInstaller/Scoop/master/schema.json",
|
|
3
|
-
"version": "13.
|
|
3
|
+
"version": "13.3.0",
|
|
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/13.
|
|
9
|
+
"url": "https://github.com/appwrite/sdk-for-cli/releases/download/13.3.0/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/13.
|
|
18
|
+
"url": "https://github.com/appwrite/sdk-for-cli/releases/download/13.3.0/appwrite-cli-win-arm64.exe",
|
|
19
19
|
"bin": [
|
|
20
20
|
[
|
|
21
21
|
"appwrite-cli-win-arm64.exe",
|