appwrite-cli 13.0.1 → 13.1.0-rc.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.
Files changed (100) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/README.md +2 -2
  3. package/bun-types.d.ts +4 -0
  4. package/bunfig.toml +2 -0
  5. package/cli.ts +3 -4
  6. package/dist/{bundle.cjs → bundle-win-arm64.mjs} +86443 -37262
  7. package/dist/cli.js +3 -3
  8. package/dist/cli.js.map +1 -1
  9. package/dist/lib/commands/config-validations.d.ts +53 -0
  10. package/dist/lib/commands/config-validations.d.ts.map +1 -0
  11. package/dist/lib/commands/config-validations.js +130 -0
  12. package/dist/lib/commands/config-validations.js.map +1 -0
  13. package/dist/lib/commands/config.d.ts +241 -325
  14. package/dist/lib/commands/config.d.ts.map +1 -1
  15. package/dist/lib/commands/config.js +86 -107
  16. package/dist/lib/commands/config.js.map +1 -1
  17. package/dist/lib/commands/generate.d.ts +7 -0
  18. package/dist/lib/commands/generate.d.ts.map +1 -0
  19. package/dist/lib/commands/generate.js +102 -0
  20. package/dist/lib/commands/generate.js.map +1 -0
  21. package/dist/lib/commands/generators/base.d.ts +58 -0
  22. package/dist/lib/commands/generators/base.d.ts.map +1 -0
  23. package/dist/lib/commands/generators/base.js +27 -0
  24. package/dist/lib/commands/generators/base.js.map +1 -0
  25. package/dist/lib/commands/generators/index.d.ts +26 -0
  26. package/dist/lib/commands/generators/index.d.ts.map +1 -0
  27. package/dist/lib/commands/generators/index.js +55 -0
  28. package/dist/lib/commands/generators/index.js.map +1 -0
  29. package/dist/lib/commands/generators/language-detector.d.ts +42 -0
  30. package/dist/lib/commands/generators/language-detector.d.ts.map +1 -0
  31. package/dist/lib/commands/generators/language-detector.js +127 -0
  32. package/dist/lib/commands/generators/language-detector.js.map +1 -0
  33. package/dist/lib/commands/generators/typescript/databases.d.ts +31 -0
  34. package/dist/lib/commands/generators/typescript/databases.d.ts.map +1 -0
  35. package/dist/lib/commands/generators/typescript/databases.js +265 -0
  36. package/dist/lib/commands/generators/typescript/databases.js.map +1 -0
  37. package/dist/lib/commands/pull.js +3 -3
  38. package/dist/lib/commands/pull.js.map +1 -1
  39. package/dist/lib/commands/push.d.ts +6 -3
  40. package/dist/lib/commands/push.d.ts.map +1 -1
  41. package/dist/lib/commands/push.js +57 -37
  42. package/dist/lib/commands/push.js.map +1 -1
  43. package/dist/lib/commands/schema.d.ts +2 -2
  44. package/dist/lib/commands/schema.d.ts.map +1 -1
  45. package/dist/lib/commands/schema.js +2 -2
  46. package/dist/lib/commands/schema.js.map +1 -1
  47. package/dist/lib/commands/utils/attributes.d.ts +5 -0
  48. package/dist/lib/commands/utils/attributes.d.ts.map +1 -1
  49. package/dist/lib/commands/utils/attributes.js +20 -10
  50. package/dist/lib/commands/utils/attributes.js.map +1 -1
  51. package/dist/lib/commands/utils/pools.d.ts +0 -3
  52. package/dist/lib/commands/utils/pools.d.ts.map +1 -1
  53. package/dist/lib/commands/utils/pools.js +0 -34
  54. package/dist/lib/commands/utils/pools.js.map +1 -1
  55. package/dist/lib/config.d.ts.map +1 -1
  56. package/dist/lib/config.js +28 -131
  57. package/dist/lib/config.js.map +1 -1
  58. package/dist/lib/constants.d.ts +1 -1
  59. package/dist/lib/constants.d.ts.map +1 -1
  60. package/dist/lib/constants.js +1 -1
  61. package/dist/lib/constants.js.map +1 -1
  62. package/dist/lib/shared/typescript-type-utils.d.ts +46 -0
  63. package/dist/lib/shared/typescript-type-utils.d.ts.map +1 -0
  64. package/dist/lib/shared/typescript-type-utils.js +155 -0
  65. package/dist/lib/shared/typescript-type-utils.js.map +1 -0
  66. package/dist/lib/type-generation/languages/typescript.d.ts +0 -1
  67. package/dist/lib/type-generation/languages/typescript.d.ts.map +1 -1
  68. package/dist/lib/type-generation/languages/typescript.js +22 -74
  69. package/dist/lib/type-generation/languages/typescript.js.map +1 -1
  70. package/dist/package.json +8 -7
  71. package/install.ps1 +2 -2
  72. package/install.sh +1 -1
  73. package/lib/commands/config-validations.ts +199 -0
  74. package/lib/commands/config.ts +94 -125
  75. package/lib/commands/generate.ts +149 -0
  76. package/lib/commands/generators/base.ts +91 -0
  77. package/lib/commands/generators/index.ts +87 -0
  78. package/lib/commands/generators/language-detector.ts +163 -0
  79. package/lib/commands/generators/typescript/databases.ts +348 -0
  80. package/lib/commands/generators/typescript/templates/constants.ts.hbs +17 -0
  81. package/lib/commands/generators/typescript/templates/databases.ts.hbs +143 -0
  82. package/lib/commands/generators/typescript/templates/index.ts.hbs +9 -0
  83. package/lib/commands/generators/typescript/templates/types.ts.hbs +41 -0
  84. package/lib/commands/pull.ts +4 -4
  85. package/lib/commands/push.ts +97 -58
  86. package/lib/commands/schema.ts +3 -3
  87. package/lib/commands/utils/attributes.ts +31 -11
  88. package/lib/commands/utils/pools.ts +0 -67
  89. package/lib/config.ts +43 -131
  90. package/lib/constants.ts +1 -1
  91. package/lib/shared/typescript-type-utils.ts +205 -0
  92. package/lib/type-generation/languages/typescript.ts +30 -85
  93. package/package.json +8 -7
  94. package/scoop/appwrite.config.json +3 -3
  95. package/tsconfig.json +1 -1
  96. package/dist/lib/commands/db.d.ts +0 -34
  97. package/dist/lib/commands/db.d.ts.map +0 -1
  98. package/dist/lib/commands/db.js +0 -247
  99. package/dist/lib/commands/db.js.map +0 -1
  100. package/lib/commands/db.ts +0 -324
package/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # Change Log
2
2
 
3
+ ## 13.1.0-rc.2
4
+
5
+ - Update generated `databases` services to automatically initialize a client instance
6
+ - Update generator to use handlebars templates
7
+
8
+ ## 13.1.0-rc.1
9
+
10
+ - Feat: `appwrite generate` command to create a fully typesafe SDK for your Appwrite project
11
+ - Chore: improve creation of columns during table creation by passing them directly instead of creating them one by one
12
+ - Improved config validation by adding extra rules in zod schema
13
+
3
14
  ## 13.0.1
4
15
 
5
16
  - Fix `project init` command leading to Cannot convert to BigInt error
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.0.1
32
+ 13.1.0-rc.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.0.1
63
+ 13.1.0-rc.2
64
64
  ```
65
65
 
66
66
  ## Getting Started
package/bun-types.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ declare module "*.hbs" {
2
+ const content: string;
3
+ export default content;
4
+ }
package/bunfig.toml ADDED
@@ -0,0 +1,2 @@
1
+ [loader]
2
+ ".hbs" = "text"
package/cli.ts CHANGED
@@ -5,7 +5,6 @@ const oldWidth = process.stdout.columns;
5
5
  process.stdout.columns = 100;
6
6
  /** ---------------------------------------------- */
7
7
 
8
- import { createRequire } from 'module';
9
8
  import { program } from 'commander';
10
9
  import chalk from 'chalk';
11
10
  import inquirer from 'inquirer';
@@ -13,6 +12,7 @@ import inquirer from 'inquirer';
13
12
  import packageJson from './package.json' with { type: 'json' };
14
13
  import { commandDescriptions, cliConfig } from './lib/parser.js';
15
14
  import { getLatestVersion, compareVersions } from './lib/utils.js';
15
+ import inquirerSearchList from 'inquirer-search-list';
16
16
 
17
17
  import { client } from './lib/commands/generic.js';
18
18
  import { login, logout, whoami, migrate, register } from './lib/commands/generic.js';
@@ -22,6 +22,7 @@ import { pull } from './lib/commands/pull.js';
22
22
  import { run } from './lib/commands/run.js';
23
23
  import { push, deploy } from './lib/commands/push.js';
24
24
  import { update } from './lib/commands/update.js';
25
+ import { generate } from './lib/commands/generate.js';
25
26
 
26
27
  import { account } from './lib/commands/services/account.js';
27
28
  import { console } from './lib/commands/services/console.js';
@@ -43,9 +44,6 @@ import { tokens } from './lib/commands/services/tokens.js';
43
44
  import { users } from './lib/commands/services/users.js';
44
45
  import { vcs } from './lib/commands/services/vcs.js';
45
46
 
46
- const require = createRequire(import.meta.url);
47
- const inquirerSearchList = require('inquirer-search-list');
48
-
49
47
  const { version } = packageJson;
50
48
  inquirer.registerPrompt('search-list', inquirerSearchList);
51
49
 
@@ -133,6 +131,7 @@ if (process.argv.includes('-v') || process.argv.includes('--version')) {
133
131
  .addCommand(deploy)
134
132
  .addCommand(run)
135
133
  .addCommand(update)
134
+ .addCommand(generate)
136
135
  .addCommand(logout)
137
136
  .addCommand(account)
138
137
  .addCommand(console)