Skip to content

Commit 96c8dad

Browse files
committed
fix: warnings
1 parent d69c482 commit 96c8dad

File tree

3 files changed

+12
-16
lines changed

3 files changed

+12
-16
lines changed

templates/cli/lib/client.js.twig

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,6 @@ class Client {
136136
},
137137
}),
138138
});
139-
140-
const warnings = response.headers.get('x-{{ spec.title | lower }}-warning');
141-
if (warnings) {
142-
warnings.split(';').forEach((warning) => console.log(`${chalk.yellow.bold("ℹ Warning:")} ${chalk.yellow(warning)}`));
143-
}
144139
} catch (error) {
145140
throw new {{spec.title | caseUcfirst}}Exception(error.message);
146141
}

templates/cli/lib/commands/pull.js.twig

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const pullResources = async () => {
2121
settings: pullSettings,
2222
functions: pullFunctions,
2323
sites: pullSites,
24-
collections: pullCollection,
24+
tables: pullTable,
2525
buckets: pullBucket,
2626
teams: pullTeam,
2727
messages: pullMessagingTopic
@@ -286,6 +286,7 @@ const pullSites = async ({ code, withVariables }) => {
286286
}
287287

288288
const pullCollection = async () => {
289+
warn("appwrite push collection has been deprecated. Please consider using 'appwrite push tables' instead");
289290
log("Fetching collections ...");
290291
let total = 0;
291292

@@ -500,7 +501,7 @@ pull
500501
pull
501502
.command("collection")
502503
.alias("collections")
503-
.description("Pull your {{ spec.title|caseUcfirst }} collections")
504+
.description("Pull your {{ spec.title|caseUcfirst }} collections (deprecated, please use 'pull tables' instead)")
504505
.action(actionRunner(pullCollection))
505506

506507
pull

templates/cli/lib/commands/push.js.twig

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1819,7 +1819,7 @@ const pushTable = async ({ returnOnZero, attempts } = { returnOnZero: false }) =
18191819
}
18201820

18211821
const pushCollection = async ({ returnOnZero, attempts } = { returnOnZero: false }) => {
1822-
warn("⚠️ DEPRECATED: Use 'appwrite push table' instead. This command might be removed in the future");
1822+
warn("appwrite push collection has been deprecated. Please consider using 'appwrite push tables' instead");
18231823
const collections = [];
18241824

18251825
if (attempts) {
@@ -1882,7 +1882,7 @@ const pushCollection = async ({ returnOnZero, attempts } = { returnOnZero: false
18821882
}));
18831883

18841884

1885-
if (!(await approveChanges(collections, databasesGetCollection, KeysCollection, 'collectionId', 'collections', ['columns', 'indexes'], 'databaseId', 'databaseId',))) {
1885+
if (!(await approveChanges(collections, databasesGetCollection, KeysCollection, 'collectionId', 'collections', ['attributes', 'indexes'], 'databaseId', 'databaseId',))) {
18861886
return;
18871887
}
18881888
// Parallel collection actions
@@ -2227,20 +2227,20 @@ push
22272227
.option("--with-variables", `Push site variables.`)
22282228
.action(actionRunner(pushSite));
22292229

2230+
push
2231+
.command("collection")
2232+
.alias("collections")
2233+
.description("Push collections in the current project. (deprecated, please use 'push tables' instead)")
2234+
.option(`-a, --attempts <numberOfAttempts>`, `Max number of attempts before timing out. default: 30.`)
2235+
.action(actionRunner(pushCollection));
2236+
22302237
push
22312238
.command("table")
22322239
.alias("tables")
22332240
.description("Push tables in the current project.")
22342241
.option(`-a, --attempts <numberOfAttempts>`, `Max number of attempts before timing out. default: 30.`)
22352242
.action(actionRunner(pushTable));
22362243

2237-
push
2238-
.command("collection")
2239-
.alias("collections")
2240-
.description("Push collections in the current project.")
2241-
.option(`-a, --attempts <numberOfAttempts>`, `Max number of attempts before timing out. default: 30.`)
2242-
.action(actionRunner(pushCollection));
2243-
22442244
push
22452245
.command("bucket")
22462246
.alias("buckets")

0 commit comments

Comments
 (0)