Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 14 additions & 10 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
name: Publish Package to npmjs

on:
release:
types: [published]

permissions:
id-token: write
contents: read
Comment on lines +7 to +9
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Fix YAML indentation syntax error.

The permissions block has inconsistent indentation. Line 8 (id-token: write) is missing proper indentation, causing a YAML syntax error that will prevent the workflow from executing.

🔎 Proposed fix
 permissions:
-id-token: write
+  id-token: write
   contents: read
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
permissions:
id-token: write
contents: read
permissions:
id-token: write
contents: read
🧰 Tools
🪛 actionlint (1.7.9)

9-9: could not parse as YAML: mapping values are not allowed in this context

(syntax-check)

🪛 YAMLlint (1.37.1)

[error] 9-9: syntax error: mapping values are not allowed here

(syntax)

🤖 Prompt for AI Agents
In .github/workflows/npm-publish.yml around lines 7 to 9, the permissions block
has incorrect indentation (line 8 'id-token: write' is not indented to align
under permissions), causing a YAML syntax error; fix by indenting the keys under
permissions consistently (make 'id-token: write' and 'contents: read' children
of 'permissions') so the permissions block is valid YAML.


jobs:
build-for-linux-and-windows:
build-and-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '16.x'
node-version: '22'
registry-url: 'https://registry.npmjs.org'
- name: Setup binfmt with QEMU
run: |
Expand All @@ -22,9 +28,9 @@ jobs:
cd ./ldid
sudo make
sudo make install
- name: Install dependenices and build for Linux and Windows
- name: Install dependencies and build for Linux and Windows
run: |
npm install
npm ci
npm run linux-x64
npm run linux-arm64
npm run windows-x64
Expand All @@ -35,13 +41,11 @@ jobs:
run: |
if ${{ contains(github.event.release.tag_name, '-rc') }}; then
echo "Publishing Release Candidate ${{ github.event.release.tag_name}} to NPM"
npm publish --tag next
npm publish --provenance --access public --tag next
else
echo "Publishing ${{ github.event.release.tag_name}} to NPM"
npm publish
npm publish --provenance --access public
fi
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN_NO_ORG }}
- uses: fnkr/github-action-ghr@v1
env:
GHR_PATH: build/
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## 13.0.0-rc.2

* Fixes a lot of typescript errors throughout the codebase

## 13.0.0-rc.1

* Migrates codebase from JavaScript to TypeScript
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Once the installation is complete, you can verify the install using

```sh
$ appwrite -v
13.0.0-rc.1
13.0.0-rc.2
```

### Install using prebuilt binaries
Expand Down Expand Up @@ -60,7 +60,7 @@ $ scoop install https://raw.githubusercontent.com/appwrite/sdk-for-cli/master/sc
Once the installation completes, you can verify your install using
```
$ appwrite -v
13.0.0-rc.1
13.0.0-rc.2
```

## Getting Started
Expand Down
2 changes: 1 addition & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const oldWidth = process.stdout.columns;
process.stdout.columns = 100;
/** ---------------------------------------------- */

import program = require('commander');
import { program } from 'commander';
import chalk = require('chalk');
const { version } = require('../package.json');
import { commandDescriptions, cliConfig } from './lib/parser';
Expand Down
4 changes: 2 additions & 2 deletions install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
# You can use "View source" of this page to see the full script.

# REPO
$GITHUB_x64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/13.0.0-rc.1/appwrite-cli-win-x64.exe"
$GITHUB_arm64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/13.0.0-rc.1/appwrite-cli-win-arm64.exe"
$GITHUB_x64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/13.0.0-rc.2/appwrite-cli-win-x64.exe"
$GITHUB_arm64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/13.0.0-rc.2/appwrite-cli-win-arm64.exe"

$APPWRITE_BINARY_NAME = "appwrite.exe"

Expand Down
2 changes: 1 addition & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ printSuccess() {
downloadBinary() {
echo "[2/4] Downloading executable for $OS ($ARCH) ..."

GITHUB_LATEST_VERSION="13.0.0-rc.1"
GITHUB_LATEST_VERSION="13.0.0-rc.2"
GITHUB_FILE="appwrite-cli-${OS}-${ARCH}"
GITHUB_URL="https://github.com/$GITHUB_REPOSITORY_NAME/releases/download/$GITHUB_LATEST_VERSION/$GITHUB_FILE"

Expand Down
10 changes: 5 additions & 5 deletions lib/client.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import os = require('os');
import { fetch, FormData, Agent } from 'undici';
import { fetch, FormData, Agent, File } from 'undici';
import JSONbig = require('json-bigint');
import AppwriteException = require('./exception');
import { globalConfig } from './config';
Expand All @@ -9,7 +9,7 @@ import type { Headers, RequestParams, ResponseType, FileUpload } from './types';
const JSONBigInt = JSONbig({ storeAsString: false });

class Client {
private readonly CHUNK_SIZE = 5 * 1024 * 1024; // 5MB
readonly CHUNK_SIZE = 5 * 1024 * 1024; // 5MB
private endpoint: string;
private headers: Headers;
private selfSigned: boolean;
Expand All @@ -22,8 +22,8 @@ class Client {
'x-sdk-name': 'Command Line',
'x-sdk-platform': 'console',
'x-sdk-language': 'cli',
'x-sdk-version': '13.0.0-rc.1',
'user-agent': `AppwriteCLI/13.0.0-rc.1 (${os.type()} ${os.version()}; ${os.arch()})`,
'x-sdk-version': '13.0.0-rc.2',
'user-agent': `AppwriteCLI/13.0.0-rc.2 (${os.type()} ${os.version()}; ${os.arch()})`,
'X-Appwrite-Response-Format': '1.8.0',
};
}
Expand Down Expand Up @@ -168,7 +168,7 @@ class Client {
for (const [key, value] of Object.entries(flatParams)) {
if (value && typeof value === 'object' && 'type' in value && value.type === 'file') {
const fileUpload = value as FileUpload;
formData.append(key, fileUpload.file as any, fileUpload.filename);
formData.append(key, fileUpload.file, fileUpload.filename);
} else {
formData.append(key, value as string);
}
Expand Down
8 changes: 6 additions & 2 deletions lib/commands/account.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import fs = require('fs');
import pathLib = require('path');
import tar = require('tar');
import ignore = require('ignore');
import ignore from 'ignore';
import { promisify } from 'util';
import Client from '../client';
import { getAllFiles, showConsoleLink } from '../utils';
Expand All @@ -11,6 +11,10 @@ import { parse, actionRunner, parseInteger, parseBool, commandDescriptions, succ
import { localConfig, globalConfig } from '../config';
import { File } from 'undici';
import { ReadableStream } from 'stream/web';
import type { UploadProgress, FileInput } from '../types';
import { AuthenticatorType } from '../enums/authenticator-type';
import { AuthenticationFactor } from '../enums/authentication-factor';
import { OAuthProvider } from '../enums/o-auth-provider';

function convertReadStreamToReadableStream(readStream: fs.ReadStream): ReadableStream {
return new ReadableStream({
Expand Down Expand Up @@ -669,7 +673,7 @@ export const accountGetPrefs = async ({parseOutput = true, overrideForCli = fals

}
interface AccountUpdatePrefsRequestParams {
prefs: object;
prefs: string;
overrideForCli?: boolean;
parseOutput?: boolean;
sdk?: Client;
Expand Down
4 changes: 3 additions & 1 deletion lib/commands/console.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import fs = require('fs');
import pathLib = require('path');
import tar = require('tar');
import ignore = require('ignore');
import ignore from 'ignore';
import { promisify } from 'util';
import Client from '../client';
import { getAllFiles, showConsoleLink } from '../utils';
Expand All @@ -11,6 +11,8 @@ import { parse, actionRunner, parseInteger, parseBool, commandDescriptions, succ
import { localConfig, globalConfig } from '../config';
import { File } from 'undici';
import { ReadableStream } from 'stream/web';
import type { UploadProgress, FileInput } from '../types';
import { ConsoleResourceType } from '../enums/console-resource-type';

function convertReadStreamToReadableStream(readStream: fs.ReadStream): ReadableStream {
return new ReadableStream({
Expand Down
Loading