From 71b8ca612c76931c682194772ffa5cacfe764fc3 Mon Sep 17 00:00:00 2001 From: Steven Nguyen Date: Thu, 22 Jun 2023 16:51:10 -0700 Subject: [PATCH 1/2] Specify the console project when checking endpoint In the future, Appwrite won't default to the console project so specifying a project will be required. --- templates/cli/lib/commands/generic.js.twig | 1 + 1 file changed, 1 insertion(+) diff --git a/templates/cli/lib/commands/generic.js.twig b/templates/cli/lib/commands/generic.js.twig index cdd1bea2c..b212d9160 100644 --- a/templates/cli/lib/commands/generic.js.twig +++ b/templates/cli/lib/commands/generic.js.twig @@ -82,6 +82,7 @@ const client = new Command("client") } let client = new Client().setEndpoint(endpoint); + client.setProject('console'); if (selfSigned || globalConfig.getSelfSigned()) { client.setSelfSigned(true); } From 295cd81bb2ca220c1ce10c2fdef3118137c0bd02 Mon Sep 17 00:00:00 2001 From: Steven Nguyen Date: Thu, 22 Jun 2023 16:53:19 -0700 Subject: [PATCH 2/2] Test the CLI against Appwrite instead of homepage A recent change to Appwrite stopped allowing loose matches for endpoints. As such, https://stage.appwrite.io/v1/health/version no longer matches https://stage.appwrite.io/version, causing tests to fail. --- tests/languages/cli/test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/languages/cli/test.js b/tests/languages/cli/test.js index 6c814738e..180edfed9 100644 --- a/tests/languages/cli/test.js +++ b/tests/languages/cli/test.js @@ -1,6 +1,6 @@ const { exec, execSync } = require('child_process'); -execSync("node index client --endpoint 'https://stage.appwrite.io/v1' --projectId console --key=35y3h5h345 --selfSigned true", { stdio: 'inherit' }); +execSync("node index client --endpoint 'https://demo.appwrite.io/v1' --projectId console --key=35y3h5h345 --selfSigned true", { stdio: 'inherit' }); var output; console.log('\nTest Started');