appwrite-cli 13.3.1 → 13.3.2

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 CHANGED
@@ -1,5 +1,10 @@
1
1
  # Change Log
2
2
 
3
+ ## 13.3.2
4
+
5
+ - Fix handle null rows in table parser
6
+ - Export config zod schemas
7
+
3
8
  ## 13.3.1
4
9
 
5
10
  - Fix generated TS imports to auto-detect ESM vs non-ESM
package/README.md CHANGED
@@ -29,7 +29,7 @@ Once the installation is complete, you can verify the install using
29
29
 
30
30
  ```sh
31
31
  $ appwrite -v
32
- 13.3.1
32
+ 13.3.2
33
33
  ```
34
34
 
35
35
  ### Install using prebuilt binaries
@@ -60,7 +60,7 @@ $ scoop install https://raw.githubusercontent.com/appwrite/sdk-for-cli/master/sc
60
60
  Once the installation completes, you can verify your install using
61
61
  ```
62
62
  $ appwrite -v
63
- 13.3.1
63
+ 13.3.2
64
64
  ```
65
65
 
66
66
  ## Getting Started
@@ -21962,9 +21962,9 @@ var require_stream_duplex = __commonJS({
21962
21962
  }
21963
21963
  });
21964
21964
 
21965
- // node_modules/safe-buffer/index.js
21965
+ // node_modules/string_decoder/node_modules/safe-buffer/index.js
21966
21966
  var require_safe_buffer = __commonJS({
21967
- "node_modules/safe-buffer/index.js"(exports, module) {
21967
+ "node_modules/string_decoder/node_modules/safe-buffer/index.js"(exports, module) {
21968
21968
  var buffer = __require("buffer");
21969
21969
  var Buffer2 = buffer.Buffer;
21970
21970
  function copyProps(src, dst) {
@@ -21981,7 +21981,6 @@ var require_safe_buffer = __commonJS({
21981
21981
  function SafeBuffer(arg, encodingOrOffset, length) {
21982
21982
  return Buffer2(arg, encodingOrOffset, length);
21983
21983
  }
21984
- SafeBuffer.prototype = Object.create(Buffer2.prototype);
21985
21984
  copyProps(Buffer2, SafeBuffer);
21986
21985
  SafeBuffer.from = function(arg, encodingOrOffset, length) {
21987
21986
  if (typeof arg === "number") {
@@ -93398,7 +93397,7 @@ var package_default = {
93398
93397
  type: "module",
93399
93398
  homepage: "https://appwrite.io/support",
93400
93399
  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",
93401
- version: "13.3.1",
93400
+ version: "13.3.2",
93402
93401
  license: "BSD-3-Clause",
93403
93402
  main: "dist/index.js",
93404
93403
  types: "dist/index.d.ts",
@@ -107662,7 +107661,7 @@ import childProcess from "child_process";
107662
107661
  // lib/constants.ts
107663
107662
  var SDK_TITLE = "Appwrite";
107664
107663
  var SDK_TITLE_LOWER = "appwrite";
107665
- var SDK_VERSION = "13.3.1";
107664
+ var SDK_VERSION = "13.3.2";
107666
107665
  var SDK_NAME = "Command Line";
107667
107666
  var SDK_PLATFORM = "console";
107668
107667
  var SDK_LANGUAGE = "cli";
@@ -134308,14 +134307,21 @@ var drawTable = (data) => {
134308
134307
  console.log("[]");
134309
134308
  return;
134310
134309
  }
134311
- const obj = data.reduce((res, item) => ({ ...res, ...item }), {});
134310
+ const rows = data.map(
134311
+ (item) => item && typeof item === "object" && !Array.isArray(item) ? item : {}
134312
+ );
134313
+ const obj = rows.reduce((res, item) => ({ ...res, ...item }), {});
134312
134314
  const keys = Object.keys(obj);
134315
+ if (keys.length === 0) {
134316
+ drawJSON(data);
134317
+ return;
134318
+ }
134313
134319
  const def = keys.reduce((result, key) => {
134314
134320
  result[key] = "-";
134315
134321
  return result;
134316
134322
  }, {});
134317
- data = data.map((item) => ({ ...def, ...item }));
134318
- const columns = Object.keys(data[0]);
134323
+ const normalizedData = rows.map((item) => ({ ...def, ...item }));
134324
+ const columns = Object.keys(normalizedData[0]);
134319
134325
  const table = new import_cli_table3.default({
134320
134326
  head: columns.map((c) => import_chalk.default.cyan.italic.bold(c)),
134321
134327
  chars: {
@@ -134336,10 +134342,10 @@ var drawTable = (data) => {
134336
134342
  middle: import_chalk.default.cyan("\u2502")
134337
134343
  }
134338
134344
  });
134339
- data.forEach((row) => {
134345
+ normalizedData.forEach((row) => {
134340
134346
  const rowValues = [];
134341
- for (const key in row) {
134342
- if (row[key] === null) {
134347
+ for (const key of columns) {
134348
+ if (row[key] == null) {
134343
134349
  rowValues.push("-");
134344
134350
  } else if (Array.isArray(row[key])) {
134345
134351
  rowValues.push(JSON.stringify(row[key]));
@@ -147995,9 +148001,6 @@ if (process.argv.includes("-v") || process.argv.includes("--version")) {
147995
148001
  }
147996
148002
  /*! Bundled license information:
147997
148003
 
147998
- safe-buffer/index.js:
147999
- (*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
148000
-
148001
148004
  undici/lib/fetch/body.js:
148002
148005
  (*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> *)
148003
148006
 
package/dist/cli.cjs CHANGED
@@ -21956,9 +21956,9 @@ var require_stream_duplex = __commonJS({
21956
21956
  }
21957
21957
  });
21958
21958
 
21959
- // node_modules/safe-buffer/index.js
21959
+ // node_modules/string_decoder/node_modules/safe-buffer/index.js
21960
21960
  var require_safe_buffer = __commonJS({
21961
- "node_modules/safe-buffer/index.js"(exports2, module2) {
21961
+ "node_modules/string_decoder/node_modules/safe-buffer/index.js"(exports2, module2) {
21962
21962
  var buffer = require("buffer");
21963
21963
  var Buffer2 = buffer.Buffer;
21964
21964
  function copyProps(src, dst) {
@@ -21975,7 +21975,6 @@ var require_safe_buffer = __commonJS({
21975
21975
  function SafeBuffer(arg, encodingOrOffset, length) {
21976
21976
  return Buffer2(arg, encodingOrOffset, length);
21977
21977
  }
21978
- SafeBuffer.prototype = Object.create(Buffer2.prototype);
21979
21978
  copyProps(Buffer2, SafeBuffer);
21980
21979
  SafeBuffer.from = function(arg, encodingOrOffset, length) {
21981
21980
  if (typeof arg === "number") {
@@ -93392,7 +93391,7 @@ var package_default = {
93392
93391
  type: "module",
93393
93392
  homepage: "https://appwrite.io/support",
93394
93393
  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",
93395
- version: "13.3.1",
93394
+ version: "13.3.2",
93396
93395
  license: "BSD-3-Clause",
93397
93396
  main: "dist/index.js",
93398
93397
  types: "dist/index.d.ts",
@@ -107656,7 +107655,7 @@ var import_undici = __toESM(require_undici(), 1);
107656
107655
  // lib/constants.ts
107657
107656
  var SDK_TITLE = "Appwrite";
107658
107657
  var SDK_TITLE_LOWER = "appwrite";
107659
- var SDK_VERSION = "13.3.1";
107658
+ var SDK_VERSION = "13.3.2";
107660
107659
  var SDK_NAME = "Command Line";
107661
107660
  var SDK_PLATFORM = "console";
107662
107661
  var SDK_LANGUAGE = "cli";
@@ -134302,14 +134301,21 @@ var drawTable = (data) => {
134302
134301
  console.log("[]");
134303
134302
  return;
134304
134303
  }
134305
- const obj = data.reduce((res, item) => ({ ...res, ...item }), {});
134304
+ const rows = data.map(
134305
+ (item) => item && typeof item === "object" && !Array.isArray(item) ? item : {}
134306
+ );
134307
+ const obj = rows.reduce((res, item) => ({ ...res, ...item }), {});
134306
134308
  const keys = Object.keys(obj);
134309
+ if (keys.length === 0) {
134310
+ drawJSON(data);
134311
+ return;
134312
+ }
134307
134313
  const def = keys.reduce((result, key) => {
134308
134314
  result[key] = "-";
134309
134315
  return result;
134310
134316
  }, {});
134311
- data = data.map((item) => ({ ...def, ...item }));
134312
- const columns = Object.keys(data[0]);
134317
+ const normalizedData = rows.map((item) => ({ ...def, ...item }));
134318
+ const columns = Object.keys(normalizedData[0]);
134313
134319
  const table = new import_cli_table3.default({
134314
134320
  head: columns.map((c) => import_chalk.default.cyan.italic.bold(c)),
134315
134321
  chars: {
@@ -134330,10 +134336,10 @@ var drawTable = (data) => {
134330
134336
  middle: import_chalk.default.cyan("\u2502")
134331
134337
  }
134332
134338
  });
134333
- data.forEach((row) => {
134339
+ normalizedData.forEach((row) => {
134334
134340
  const rowValues = [];
134335
- for (const key in row) {
134336
- if (row[key] === null) {
134341
+ for (const key of columns) {
134342
+ if (row[key] == null) {
134337
134343
  rowValues.push("-");
134338
134344
  } else if (Array.isArray(row[key])) {
134339
134345
  rowValues.push(JSON.stringify(row[key]));
@@ -147989,9 +147995,6 @@ if (process.argv.includes("-v") || process.argv.includes("--version")) {
147989
147995
  }
147990
147996
  /*! Bundled license information:
147991
147997
 
147992
- safe-buffer/index.js:
147993
- (*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
147994
-
147995
147998
  undici/lib/fetch/body.js:
147996
147999
  (*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> *)
147997
148000
 
package/dist/index.d.ts CHANGED
@@ -8,4 +8,5 @@ import { Pull } from "./lib/commands/pull.js";
8
8
  import { Schema } from "./lib/commands/schema.js";
9
9
  export { Schema, Push, Pull };
10
10
  export type { ConfigType, SettingsType, FunctionType, SiteType, DatabaseType, CollectionType, TableType, TopicType, TeamType, MessageType, BucketType, AttributeType, IndexType, ColumnType, TableIndexType, } from "./lib/commands/config.js";
11
+ export { ConfigSchema, SettingsSchema, SiteSchema, FunctionSchema, DatabaseSchema, CollectionSchema, AttributeSchema, IndexSchema, TableSchema, ColumnSchema, IndexTableSchema, TopicSchema, TeamSchema, MessageSchema, BucketSchema, } from "./lib/commands/config.js";
11
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAElD,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;AAC9B,YAAY,EACV,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,YAAY,EACZ,cAAc,EACd,SAAS,EACT,SAAS,EACT,QAAQ,EACR,WAAW,EACX,UAAU,EACV,aAAa,EACb,SAAS,EACT,UAAU,EACV,cAAc,GACf,MAAM,0BAA0B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAElD,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;AAC9B,YAAY,EACV,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,YAAY,EACZ,cAAc,EACd,SAAS,EACT,SAAS,EACT,QAAQ,EACR,WAAW,EACX,UAAU,EACV,aAAa,EACb,SAAS,EACT,UAAU,EACV,cAAc,GACf,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,YAAY,EACZ,cAAc,EACd,UAAU,EACV,cAAc,EACd,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,WAAW,EACX,WAAW,EACX,YAAY,EACZ,gBAAgB,EAChB,WAAW,EACX,UAAU,EACV,aAAa,EACb,YAAY,GACb,MAAM,0BAA0B,CAAC"}
package/dist/index.js CHANGED
@@ -19586,9 +19586,9 @@ var require_stream_duplex = __commonJS({
19586
19586
  }
19587
19587
  });
19588
19588
 
19589
- // node_modules/safe-buffer/index.js
19589
+ // node_modules/string_decoder/node_modules/safe-buffer/index.js
19590
19590
  var require_safe_buffer = __commonJS({
19591
- "node_modules/safe-buffer/index.js"(exports, module) {
19591
+ "node_modules/string_decoder/node_modules/safe-buffer/index.js"(exports, module) {
19592
19592
  var buffer = __require("buffer");
19593
19593
  var Buffer2 = buffer.Buffer;
19594
19594
  function copyProps(src, dst) {
@@ -19605,7 +19605,6 @@ var require_safe_buffer = __commonJS({
19605
19605
  function SafeBuffer(arg, encodingOrOffset, length) {
19606
19606
  return Buffer2(arg, encodingOrOffset, length);
19607
19607
  }
19608
- SafeBuffer.prototype = Object.create(Buffer2.prototype);
19609
19608
  copyProps(Buffer2, SafeBuffer);
19610
19609
  SafeBuffer.from = function(arg, encodingOrOffset, length) {
19611
19610
  if (typeof arg === "number") {
@@ -70688,7 +70687,7 @@ var id_default = ID;
70688
70687
  // lib/constants.ts
70689
70688
  var SDK_TITLE = "Appwrite";
70690
70689
  var SDK_TITLE_LOWER = "appwrite";
70691
- var SDK_VERSION = "13.3.1";
70690
+ var SDK_VERSION = "13.3.2";
70692
70691
  var SDK_LOGO = "\n _ _ _ ___ __ _____\n /_\\ _ __ _ ____ ___ __(_) |_ ___ / __\\ / / \\_ \\\n //_\\\\| '_ \\| '_ \\ \\ /\\ / / '__| | __/ _ \\ / / / / / /\\/\n / _ \\ |_) | |_) \\ V V /| | | | || __/ / /___/ /___/\\/ /_\n \\_/ \\_/ .__/| .__/ \\_/\\_/ |_| |_|\\__\\___| \\____/\\____/\\____/\n |_| |_|\n\n";
70693
70692
  var EXECUTABLE_NAME = "appwrite";
70694
70693
  var NPM_PACKAGE_NAME = "appwrite-cli";
@@ -106401,7 +106400,7 @@ var package_default = {
106401
106400
  type: "module",
106402
106401
  homepage: "https://appwrite.io/support",
106403
106402
  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",
106404
- version: "13.3.1",
106403
+ version: "13.3.2",
106405
106404
  license: "BSD-3-Clause",
106406
106405
  main: "dist/index.js",
106407
106406
  types: "dist/index.d.ts",
@@ -106487,14 +106486,21 @@ var drawTable = (data) => {
106487
106486
  console.log("[]");
106488
106487
  return;
106489
106488
  }
106490
- const obj = data.reduce((res, item) => ({ ...res, ...item }), {});
106489
+ const rows = data.map(
106490
+ (item) => item && typeof item === "object" && !Array.isArray(item) ? item : {}
106491
+ );
106492
+ const obj = rows.reduce((res, item) => ({ ...res, ...item }), {});
106491
106493
  const keys = Object.keys(obj);
106494
+ if (keys.length === 0) {
106495
+ drawJSON(data);
106496
+ return;
106497
+ }
106492
106498
  const def = keys.reduce((result, key) => {
106493
106499
  result[key] = "-";
106494
106500
  return result;
106495
106501
  }, {});
106496
- data = data.map((item) => ({ ...def, ...item }));
106497
- const columns = Object.keys(data[0]);
106502
+ const normalizedData = rows.map((item) => ({ ...def, ...item }));
106503
+ const columns = Object.keys(normalizedData[0]);
106498
106504
  const table = new import_cli_table3.default({
106499
106505
  head: columns.map((c) => import_chalk2.default.cyan.italic.bold(c)),
106500
106506
  chars: {
@@ -106515,10 +106521,10 @@ var drawTable = (data) => {
106515
106521
  middle: import_chalk2.default.cyan("\u2502")
106516
106522
  }
106517
106523
  });
106518
- data.forEach((row) => {
106524
+ normalizedData.forEach((row) => {
106519
106525
  const rowValues = [];
106520
- for (const key in row) {
106521
- if (row[key] === null) {
106526
+ for (const key of columns) {
106527
+ if (row[key] == null) {
106522
106528
  rowValues.push("-");
106523
106529
  } else if (Array.isArray(row[key])) {
106524
106530
  rowValues.push(JSON.stringify(row[key]));
@@ -106532,6 +106538,9 @@ var drawTable = (data) => {
106532
106538
  });
106533
106539
  console.log(table.toString());
106534
106540
  };
106541
+ var drawJSON = (data) => {
106542
+ console.log(JSON.stringify(data, null, 2));
106543
+ };
106535
106544
  var parseError = (err) => {
106536
106545
  if (cliConfig.report) {
106537
106546
  (async () => {
@@ -111906,15 +111915,27 @@ var Schema = class {
111906
111915
  }
111907
111916
  };
111908
111917
  export {
111918
+ AttributeSchema,
111919
+ BucketSchema,
111920
+ CollectionSchema,
111921
+ ColumnSchema,
111922
+ ConfigSchema,
111923
+ DatabaseSchema,
111924
+ FunctionSchema,
111925
+ IndexSchema,
111926
+ IndexTableSchema,
111927
+ MessageSchema,
111909
111928
  Pull,
111910
111929
  Push,
111911
- Schema
111930
+ Schema,
111931
+ SettingsSchema,
111932
+ SiteSchema,
111933
+ TableSchema,
111934
+ TeamSchema,
111935
+ TopicSchema
111912
111936
  };
111913
111937
  /*! Bundled license information:
111914
111938
 
111915
- safe-buffer/index.js:
111916
- (*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
111917
-
111918
111939
  undici/lib/fetch/body.js:
111919
111940
  (*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> *)
111920
111941
 
@@ -1,6 +1,6 @@
1
1
  export declare const SDK_TITLE = "Appwrite";
2
2
  export declare const SDK_TITLE_LOWER = "appwrite";
3
- export declare const SDK_VERSION = "13.3.1";
3
+ export declare const SDK_VERSION = "13.3.2";
4
4
  export declare const SDK_NAME = "Command Line";
5
5
  export declare const SDK_PLATFORM = "console";
6
6
  export declare const SDK_LANGUAGE = "cli";
@@ -1,7 +1,7 @@
1
1
  import type { CliConfig } from "./types.js";
2
2
  declare const cliConfig: CliConfig;
3
3
  export declare const parse: (data: Record<string, any>) => void;
4
- export declare const drawTable: (data: Array<Record<string, any>>) => void;
4
+ export declare const drawTable: (data: Array<Record<string, any> | null | undefined>) => void;
5
5
  export declare const drawJSON: (data: any) => void;
6
6
  export declare const parseError: (err: Error) => void;
7
7
  export declare const actionRunner: <T extends (...args: any[]) => Promise<any>>(fn: T) => ((...args: Parameters<T>) => Promise<void>);
@@ -1 +1 @@
1
- {"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../lib/parser.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAQ5C,QAAA,MAAM,SAAS,EAAE,SAQhB,CAAC;AAEF,eAAO,MAAM,KAAK,GAAI,MAAM,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAG,IA2BjD,CAAC;AAEF,eAAO,MAAM,SAAS,GAAI,MAAM,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,KAAG,IAyD5D,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,MAAM,GAAG,KAAG,IAEpC,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,KAAK,KAAK,KAAG,IA2DvC,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,CAAC,GAAG,CAAC,EACrE,IAAI,CAAC,KACJ,CAAC,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAY5C,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,OAAO,MAAM,KAAG,MAM5C,CAAC;AAEF,eAAO,MAAM,SAAS,GAAI,OAAO,MAAM,KAAG,OAIzC,CAAC;AAEF,eAAO,MAAM,GAAG,GAAI,UAAU,MAAM,KAAG,IAEtC,CAAC;AAEF,eAAO,MAAM,IAAI,GAAI,UAAU,MAAM,KAAG,IAIvC,CAAC;AAEF,eAAO,MAAM,IAAI,GAAI,UAAU,MAAM,KAAG,IAEvC,CAAC;AAEF,eAAO,MAAM,OAAO,GAAI,UAAU,MAAM,KAAG,IAI1C,CAAC;AAEF,eAAO,MAAM,KAAK,GAAI,UAAU,MAAM,KAAG,IAExC,CAAC;AAEF,eAAO,MAAM,IAAI,wXAAW,CAAC;AAE7B,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CA+BtD,CAAC;AAEF,OAAO,EAAE,SAAS,EAAE,CAAC"}
1
+ {"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../lib/parser.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAQ5C,QAAA,MAAM,SAAS,EAAE,SAQhB,CAAC;AAEF,eAAO,MAAM,KAAK,GAAI,MAAM,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAG,IA2BjD,CAAC;AAEF,eAAO,MAAM,SAAS,GACpB,MAAM,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,GAAG,SAAS,CAAC,KAClD,IAiEF,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,MAAM,GAAG,KAAG,IAEpC,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,KAAK,KAAK,KAAG,IA2DvC,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,CAAC,GAAG,CAAC,EACrE,IAAI,CAAC,KACJ,CAAC,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAY5C,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,OAAO,MAAM,KAAG,MAM5C,CAAC;AAEF,eAAO,MAAM,SAAS,GAAI,OAAO,MAAM,KAAG,OAIzC,CAAC;AAEF,eAAO,MAAM,GAAG,GAAI,UAAU,MAAM,KAAG,IAEtC,CAAC;AAEF,eAAO,MAAM,IAAI,GAAI,UAAU,MAAM,KAAG,IAIvC,CAAC;AAEF,eAAO,MAAM,IAAI,GAAI,UAAU,MAAM,KAAG,IAEvC,CAAC;AAEF,eAAO,MAAM,OAAO,GAAI,UAAU,MAAM,KAAG,IAI1C,CAAC;AAEF,eAAO,MAAM,KAAK,GAAI,UAAU,MAAM,KAAG,IAExC,CAAC;AAEF,eAAO,MAAM,IAAI,wXAAW,CAAC;AAE7B,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CA+BtD,CAAC;AAEF,OAAO,EAAE,SAAS,EAAE,CAAC"}
package/index.ts CHANGED
@@ -26,3 +26,20 @@ export type {
26
26
  ColumnType,
27
27
  TableIndexType,
28
28
  } from "./lib/commands/config.js";
29
+ export {
30
+ ConfigSchema,
31
+ SettingsSchema,
32
+ SiteSchema,
33
+ FunctionSchema,
34
+ DatabaseSchema,
35
+ CollectionSchema,
36
+ AttributeSchema,
37
+ IndexSchema,
38
+ TableSchema,
39
+ ColumnSchema,
40
+ IndexTableSchema,
41
+ TopicSchema,
42
+ TeamSchema,
43
+ MessageSchema,
44
+ BucketSchema,
45
+ } from "./lib/commands/config.js";
package/install.ps1 CHANGED
@@ -13,8 +13,8 @@
13
13
  # You can use "View source" of this page to see the full script.
14
14
 
15
15
  # REPO
16
- $GITHUB_x64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/13.3.1/appwrite-cli-win-x64.exe"
17
- $GITHUB_arm64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/13.3.1/appwrite-cli-win-arm64.exe"
16
+ $GITHUB_x64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/13.3.2/appwrite-cli-win-x64.exe"
17
+ $GITHUB_arm64_URL = "https://github.com/appwrite/sdk-for-cli/releases/download/13.3.2/appwrite-cli-win-arm64.exe"
18
18
 
19
19
  $APPWRITE_BINARY_NAME = "appwrite.exe"
20
20
 
package/install.sh CHANGED
@@ -96,7 +96,7 @@ printSuccess() {
96
96
  downloadBinary() {
97
97
  echo "[2/4] Downloading executable for $OS ($ARCH) ..."
98
98
 
99
- GITHUB_LATEST_VERSION="13.3.1"
99
+ GITHUB_LATEST_VERSION="13.3.2"
100
100
  GITHUB_FILE="appwrite-cli-${OS}-${ARCH}"
101
101
  GITHUB_URL="https://github.com/$GITHUB_REPOSITORY_NAME/releases/download/$GITHUB_LATEST_VERSION/$GITHUB_FILE"
102
102
 
package/lib/constants.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  // SDK
2
2
  export const SDK_TITLE = 'Appwrite';
3
3
  export const SDK_TITLE_LOWER = 'appwrite';
4
- export const SDK_VERSION = '13.3.1';
4
+ export const SDK_VERSION = '13.3.2';
5
5
  export const SDK_NAME = 'Command Line';
6
6
  export const SDK_PLATFORM = 'console';
7
7
  export const SDK_LANGUAGE = 'cli';
package/lib/parser.ts CHANGED
@@ -54,25 +54,35 @@ export const parse = (data: Record<string, any>): void => {
54
54
  }
55
55
  };
56
56
 
57
- export const drawTable = (data: Array<Record<string, any>>): void => {
57
+ export const drawTable = (
58
+ data: Array<Record<string, any> | null | undefined>,
59
+ ): void => {
58
60
  if (data.length == 0) {
59
61
  console.log("[]");
60
62
  return;
61
63
  }
62
64
 
65
+ const rows = data.map((item) =>
66
+ item && typeof item === "object" && !Array.isArray(item) ? item : {},
67
+ );
68
+
63
69
  // Create an object with all the keys in it
64
- const obj = data.reduce((res, item) => ({ ...res, ...item }), {});
70
+ const obj = rows.reduce((res, item) => ({ ...res, ...item }), {});
65
71
  // Get those keys as an array
66
72
  const keys = Object.keys(obj);
73
+ if (keys.length === 0) {
74
+ drawJSON(data);
75
+ return;
76
+ }
67
77
  // Create an object with all keys set to the default value ''
68
78
  const def = keys.reduce((result: Record<string, string>, key) => {
69
79
  result[key] = "-";
70
80
  return result;
71
81
  }, {});
72
82
  // Use object destructuring to replace all default values with the ones we have
73
- data = data.map((item) => ({ ...def, ...item }));
83
+ const normalizedData = rows.map((item) => ({ ...def, ...item }));
74
84
 
75
- const columns = Object.keys(data[0]);
85
+ const columns = Object.keys(normalizedData[0]);
76
86
 
77
87
  const table = new Table({
78
88
  head: columns.map((c) => chalk.cyan.italic.bold(c)),
@@ -95,10 +105,10 @@ export const drawTable = (data: Array<Record<string, any>>): void => {
95
105
  },
96
106
  });
97
107
 
98
- data.forEach((row) => {
108
+ normalizedData.forEach((row) => {
99
109
  const rowValues: any[] = [];
100
- for (const key in row) {
101
- if (row[key] === null) {
110
+ for (const key of columns) {
111
+ if (row[key] == null) {
102
112
  rowValues.push("-");
103
113
  } else if (Array.isArray(row[key])) {
104
114
  rowValues.push(JSON.stringify(row[key]));
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.3.1",
6
+ "version": "13.3.2",
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.1",
3
+ "version": "13.3.2",
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.3.1/appwrite-cli-win-x64.exe",
9
+ "url": "https://github.com/appwrite/sdk-for-cli/releases/download/13.3.2/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.3.1/appwrite-cli-win-arm64.exe",
18
+ "url": "https://github.com/appwrite/sdk-for-cli/releases/download/13.3.2/appwrite-cli-win-arm64.exe",
19
19
  "bin": [
20
20
  [
21
21
  "appwrite-cli-win-arm64.exe",