@njdamstra/appwrite-utils-cli 1.10.0 → 1.10.1

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.
@@ -32,6 +32,10 @@ interface ColumnOperationPlan {
32
32
  // Property configuration for different column types
33
33
  const MUTABLE_PROPERTIES = {
34
34
  string: ["required", "default", "size", "array"],
35
+ varchar: ["required", "default", "size", "array"],
36
+ text: ["required", "default", "array"],
37
+ mediumtext: ["required", "default", "array"],
38
+ longtext: ["required", "default", "array"],
35
39
  integer: ["required", "default", "min", "max", "array"],
36
40
  float: ["required", "default", "min", "max", "array"],
37
41
  double: ["required", "default", "min", "max", "array"],
@@ -41,11 +45,18 @@ const MUTABLE_PROPERTIES = {
41
45
  ip: ["required", "default", "array"],
42
46
  url: ["required", "default", "array"],
43
47
  enum: ["required", "default", "elements", "array"],
48
+ point: ["required", "default"],
49
+ line: ["required", "default"],
50
+ polygon: ["required", "default"],
44
51
  relationship: ["required", "default"],
45
52
  } as const;
46
53
 
47
54
  const IMMUTABLE_PROPERTIES = {
48
55
  string: ["encrypt", "key"],
56
+ varchar: ["encrypt", "key"],
57
+ text: ["encrypt", "key"],
58
+ mediumtext: ["encrypt", "key"],
59
+ longtext: ["encrypt", "key"],
49
60
  integer: ["encrypt", "key"],
50
61
  float: ["encrypt", "key"],
51
62
  double: ["encrypt", "key"],
@@ -55,11 +66,18 @@ const IMMUTABLE_PROPERTIES = {
55
66
  ip: ["key"],
56
67
  url: ["key"],
57
68
  enum: ["key"],
69
+ point: ["key"],
70
+ line: ["key"],
71
+ polygon: ["key"],
58
72
  relationship: ["key", "relatedCollection", "relationType", "twoWay", "twoWayKey", "onDelete"],
59
73
  } as const;
60
74
 
61
75
  const TYPE_CHANGE_REQUIRES_RECREATE = [
62
76
  "string",
77
+ "varchar",
78
+ "text",
79
+ "mediumtext",
80
+ "longtext",
63
81
  "integer",
64
82
  "float",
65
83
  "double",
@@ -69,6 +87,9 @@ const TYPE_CHANGE_REQUIRES_RECREATE = [
69
87
  "ip",
70
88
  "url",
71
89
  "enum",
90
+ "point",
91
+ "line",
92
+ "polygon",
72
93
  "relationship",
73
94
  ];
74
95
 
@@ -117,6 +138,13 @@ export function normalizeAttributeToComparable(attr: Attribute): ComparableColum
117
138
  base.size = (attr as any).size ?? 255;
118
139
  base.encrypt = !!((attr as any).encrypt);
119
140
  }
141
+ if (t === 'varchar') {
142
+ base.size = (attr as any).size ?? 255;
143
+ base.encrypt = !!((attr as any).encrypt);
144
+ }
145
+ if (t === 'text' || t === 'mediumtext' || t === 'longtext') {
146
+ base.encrypt = !!((attr as any).encrypt);
147
+ }
120
148
  if (t === 'integer' || t === 'float' || t === 'double') {
121
149
  const min = toNumber((attr as any).min);
122
150
  const max = toNumber((attr as any).max);
@@ -162,6 +190,13 @@ export function normalizeColumnToComparable(col: any): ComparableColumn {
162
190
  base.size = typeof col?.size === 'number' ? col.size : undefined;
163
191
  base.encrypt = !!col?.encrypt;
164
192
  }
193
+ if (t === 'varchar') {
194
+ base.size = typeof col?.size === 'number' ? col.size : undefined;
195
+ base.encrypt = !!col?.encrypt;
196
+ }
197
+ if (t === 'text' || t === 'mediumtext' || t === 'longtext') {
198
+ base.encrypt = !!col?.encrypt;
199
+ }
165
200
  if (t === 'integer' || t === 'float' || t === 'double') {
166
201
  // Preserve raw min/max without forcing extremes; compare with Decimal in shallowEqual
167
202
  const rawMin = (col as any)?.min;
@@ -137,7 +137,7 @@ export const createFunction = async (
137
137
  functionConfig.logging,
138
138
  functionConfig.entrypoint,
139
139
  functionConfig.commands,
140
- functionConfig.scopes,
140
+ functionConfig.scopes as any[],
141
141
  functionConfig.installationId,
142
142
  functionConfig.providerRepositoryId,
143
143
  functionConfig.providerBranch,
@@ -217,7 +217,7 @@ export const updateFunction = async (
217
217
  functionConfig.logging,
218
218
  functionConfig.entrypoint,
219
219
  functionConfig.commands,
220
- functionConfig.scopes,
220
+ functionConfig.scopes as any[],
221
221
  functionConfig.installationId,
222
222
  functionConfig.providerRepositoryId,
223
223
  functionConfig.providerBranch,
@@ -92,7 +92,7 @@ export class InteractiveCLI {
92
92
  async run(): Promise<void> {
93
93
  MessageFormatter.banner(
94
94
  "Appwrite Utils CLI",
95
- "Welcome to Appwrite Utils CLI Tool by Zach Handley"
95
+ "Welcome to Appwrite Utils CLI Tool"
96
96
  );
97
97
  MessageFormatter.info(
98
98
  "For more information, visit https://github.com/njdamstra/AppwriteUtils"
@@ -1069,7 +1069,7 @@ export class InteractiveCLI {
1069
1069
  compression: bucketCompressionType as Compression,
1070
1070
  encryption: bucketEncryption,
1071
1071
  antivirus: bucketAntivirus,
1072
- },
1072
+ } as any,
1073
1073
  bucketId.length > 0 ? bucketId : ulid()
1074
1074
  );
1075
1075
  }
@@ -1111,7 +1111,7 @@ export class InteractiveCLI {
1111
1111
  name: db.name,
1112
1112
  enabled: true,
1113
1113
  type: "tablesdb" as DatabaseType,
1114
- }));
1114
+ } as Models.Database));
1115
1115
  }
1116
1116
 
1117
1117