appwrite-cli 12.0.1 → 13.0.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.
- package/.github/workflows/build-verify.yml +71 -0
- package/.github/workflows/npm-publish.yml +41 -22
- package/CHANGELOG.md +108 -100
- package/LICENSE.md +1 -1
- package/README.md +58 -35
- package/bun.lock +625 -0
- package/dist/bundle.cjs +94853 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +145 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/client.d.ts +88 -0
- package/dist/lib/client.d.ts.map +1 -0
- package/dist/lib/client.js +238 -0
- package/dist/lib/client.js.map +1 -0
- package/dist/lib/commands/generic.d.ts +17 -0
- package/dist/lib/commands/generic.d.ts.map +1 -0
- package/dist/lib/commands/generic.js +292 -0
- package/dist/lib/commands/generic.js.map +1 -0
- package/dist/lib/commands/init.d.ts +3 -0
- package/dist/lib/commands/init.d.ts.map +1 -0
- package/{lib → dist/lib}/commands/init.js +186 -270
- package/dist/lib/commands/init.js.map +1 -0
- package/dist/lib/commands/pull.d.ts +8 -0
- package/dist/lib/commands/pull.d.ts.map +1 -0
- package/{lib → dist/lib}/commands/pull.js +159 -280
- package/dist/lib/commands/pull.js.map +1 -0
- package/dist/lib/commands/push.d.ts +4 -0
- package/dist/lib/commands/push.d.ts.map +1 -0
- package/dist/lib/commands/push.js +2127 -0
- package/dist/lib/commands/push.js.map +1 -0
- package/dist/lib/commands/run.d.ts +3 -0
- package/dist/lib/commands/run.d.ts.map +1 -0
- package/{lib → dist/lib}/commands/run.js +146 -187
- package/dist/lib/commands/run.js.map +1 -0
- package/dist/lib/commands/services/account.d.ts +3 -0
- package/dist/lib/commands/services/account.d.ts.map +1 -0
- package/dist/lib/commands/services/account.js +306 -0
- package/dist/lib/commands/services/account.js.map +1 -0
- package/dist/lib/commands/services/avatars.d.ts +3 -0
- package/dist/lib/commands/services/avatars.d.ts.map +1 -0
- package/dist/lib/commands/services/avatars.js +118 -0
- package/dist/lib/commands/services/avatars.js.map +1 -0
- package/dist/lib/commands/services/console.d.ts +3 -0
- package/dist/lib/commands/services/console.d.ts.map +1 -0
- package/dist/lib/commands/services/console.js +41 -0
- package/dist/lib/commands/services/console.js.map +1 -0
- package/dist/lib/commands/services/databases.d.ts +3 -0
- package/dist/lib/commands/services/databases.d.ts.map +1 -0
- package/dist/lib/commands/services/databases.js +612 -0
- package/dist/lib/commands/services/databases.js.map +1 -0
- package/dist/lib/commands/services/functions.d.ts +3 -0
- package/dist/lib/commands/services/functions.d.ts.map +1 -0
- package/dist/lib/commands/services/functions.js +258 -0
- package/dist/lib/commands/services/functions.js.map +1 -0
- package/dist/lib/commands/services/graphql.d.ts +3 -0
- package/dist/lib/commands/services/graphql.d.ts.map +1 -0
- package/dist/lib/commands/services/graphql.js +28 -0
- package/dist/lib/commands/services/graphql.js.map +1 -0
- package/dist/lib/commands/services/health.d.ts +3 -0
- package/dist/lib/commands/services/health.d.ts.map +1 -0
- package/dist/lib/commands/services/health.js +123 -0
- package/dist/lib/commands/services/health.js.map +1 -0
- package/dist/lib/commands/services/locale.d.ts +3 -0
- package/dist/lib/commands/services/locale.d.ts.map +1 -0
- package/dist/lib/commands/services/locale.js +52 -0
- package/dist/lib/commands/services/locale.js.map +1 -0
- package/dist/lib/commands/services/messaging.d.ts +3 -0
- package/dist/lib/commands/services/messaging.d.ts.map +1 -0
- package/dist/lib/commands/services/messaging.js +505 -0
- package/dist/lib/commands/services/messaging.js.map +1 -0
- package/dist/lib/commands/services/migrations.d.ts +3 -0
- package/dist/lib/commands/services/migrations.d.ts.map +1 -0
- package/dist/lib/commands/services/migrations.js +135 -0
- package/dist/lib/commands/services/migrations.js.map +1 -0
- package/dist/lib/commands/services/project.d.ts +3 -0
- package/dist/lib/commands/services/project.d.ts.map +1 -0
- package/dist/lib/commands/services/project.js +54 -0
- package/dist/lib/commands/services/project.js.map +1 -0
- package/dist/lib/commands/services/projects.d.ts +3 -0
- package/dist/lib/commands/services/projects.d.ts.map +1 -0
- package/dist/lib/commands/services/projects.js +415 -0
- package/dist/lib/commands/services/projects.js.map +1 -0
- package/dist/lib/commands/services/proxy.d.ts +3 -0
- package/dist/lib/commands/services/proxy.d.ts.map +1 -0
- package/dist/lib/commands/services/proxy.js +68 -0
- package/dist/lib/commands/services/proxy.js.map +1 -0
- package/dist/lib/commands/services/sites.d.ts +3 -0
- package/dist/lib/commands/services/sites.d.ts.map +1 -0
- package/dist/lib/commands/services/sites.js +242 -0
- package/dist/lib/commands/services/sites.js.map +1 -0
- package/dist/lib/commands/services/storage.d.ts +3 -0
- package/dist/lib/commands/services/storage.d.ts.map +1 -0
- package/dist/lib/commands/services/storage.js +153 -0
- package/dist/lib/commands/services/storage.js.map +1 -0
- package/dist/lib/commands/services/tablesdb.d.ts +3 -0
- package/dist/lib/commands/services/tablesdb.d.ts.map +1 -0
- package/dist/lib/commands/services/tablesdb.js +605 -0
- package/dist/lib/commands/services/tablesdb.js.map +1 -0
- package/dist/lib/commands/services/teams.d.ts +3 -0
- package/dist/lib/commands/services/teams.d.ts.map +1 -0
- package/dist/lib/commands/services/teams.js +123 -0
- package/dist/lib/commands/services/teams.js.map +1 -0
- package/dist/lib/commands/services/tokens.d.ts +3 -0
- package/dist/lib/commands/services/tokens.d.ts.map +1 -0
- package/dist/lib/commands/services/tokens.js +49 -0
- package/dist/lib/commands/services/tokens.js.map +1 -0
- package/dist/lib/commands/services/users.d.ts +3 -0
- package/dist/lib/commands/services/users.d.ts.map +1 -0
- package/dist/lib/commands/services/users.js +312 -0
- package/dist/lib/commands/services/users.js.map +1 -0
- package/dist/lib/commands/services/vcs.d.ts +3 -0
- package/dist/lib/commands/services/vcs.d.ts.map +1 -0
- package/dist/lib/commands/services/vcs.js +87 -0
- package/dist/lib/commands/services/vcs.js.map +1 -0
- package/dist/lib/commands/types.d.ts +3 -0
- package/dist/lib/commands/types.d.ts.map +1 -0
- package/dist/lib/commands/types.js +151 -0
- package/dist/lib/commands/types.js.map +1 -0
- package/dist/lib/commands/update.d.ts +3 -0
- package/dist/lib/commands/update.d.ts.map +1 -0
- package/{lib → dist/lib}/commands/update.js +62 -79
- package/dist/lib/commands/update.js.map +1 -0
- package/dist/lib/config.d.ts +118 -0
- package/dist/lib/config.d.ts.map +1 -0
- package/{lib → dist/lib}/config.js +173 -232
- package/dist/lib/config.js.map +1 -0
- package/dist/lib/emulation/docker.d.ts +7 -0
- package/dist/lib/emulation/docker.d.ts.map +1 -0
- package/dist/lib/emulation/docker.js +224 -0
- package/dist/lib/emulation/docker.js.map +1 -0
- package/dist/lib/emulation/utils.d.ts +29 -0
- package/dist/lib/emulation/utils.d.ts.map +1 -0
- package/{lib → dist/lib}/emulation/utils.js +70 -91
- package/dist/lib/emulation/utils.js.map +1 -0
- package/dist/lib/id.d.ts +7 -0
- package/dist/lib/id.d.ts.map +1 -0
- package/{lib → dist/lib}/id.js +5 -8
- package/dist/lib/id.js.map +1 -0
- package/dist/lib/paginate.d.ts +9 -0
- package/dist/lib/paginate.d.ts.map +1 -0
- package/{lib → dist/lib}/paginate.js +10 -19
- package/dist/lib/paginate.js.map +1 -0
- package/dist/lib/parser.d.ts +18 -0
- package/dist/lib/parser.d.ts.map +1 -0
- package/dist/lib/parser.js +225 -0
- package/dist/lib/parser.js.map +1 -0
- package/dist/lib/questions.d.ts +59 -0
- package/dist/lib/questions.d.ts.map +1 -0
- package/{lib → dist/lib}/questions.js +393 -500
- package/dist/lib/questions.js.map +1 -0
- package/dist/lib/sdks.d.ts +4 -0
- package/dist/lib/sdks.d.ts.map +1 -0
- package/dist/lib/sdks.js +61 -0
- package/dist/lib/sdks.js.map +1 -0
- package/dist/lib/services.d.ts +13 -0
- package/dist/lib/services.d.ts.map +1 -0
- package/dist/lib/services.js +47 -0
- package/dist/lib/services.js.map +1 -0
- package/dist/lib/spinner.d.ts +28 -0
- package/dist/lib/spinner.d.ts.map +1 -0
- package/dist/lib/spinner.js +91 -0
- package/dist/lib/spinner.js.map +1 -0
- package/dist/lib/type-generation/attribute.d.ts +17 -0
- package/dist/lib/type-generation/attribute.d.ts.map +1 -0
- package/{lib → dist/lib}/type-generation/attribute.js +2 -5
- package/dist/lib/type-generation/attribute.js.map +1 -0
- package/dist/lib/type-generation/languages/csharp.d.ts +7 -0
- package/dist/lib/type-generation/languages/csharp.d.ts.map +1 -0
- package/dist/lib/type-generation/languages/csharp.js +180 -0
- package/dist/lib/type-generation/languages/csharp.js.map +1 -0
- package/dist/lib/type-generation/languages/dart.d.ts +8 -0
- package/dist/lib/type-generation/languages/dart.d.ts.map +1 -0
- package/dist/lib/type-generation/languages/dart.js +197 -0
- package/dist/lib/type-generation/languages/dart.js.map +1 -0
- package/dist/lib/type-generation/languages/java.d.ts +7 -0
- package/dist/lib/type-generation/languages/java.d.ts.map +1 -0
- package/dist/lib/type-generation/languages/java.js +140 -0
- package/dist/lib/type-generation/languages/java.js.map +1 -0
- package/dist/lib/type-generation/languages/javascript.d.ts +9 -0
- package/dist/lib/type-generation/languages/javascript.d.ts.map +1 -0
- package/dist/lib/type-generation/languages/javascript.js +109 -0
- package/dist/lib/type-generation/languages/javascript.js.map +1 -0
- package/dist/lib/type-generation/languages/kotlin.d.ts +7 -0
- package/dist/lib/type-generation/languages/kotlin.d.ts.map +1 -0
- package/dist/lib/type-generation/languages/kotlin.js +95 -0
- package/dist/lib/type-generation/languages/kotlin.js.map +1 -0
- package/dist/lib/type-generation/languages/language.d.ts +43 -0
- package/dist/lib/type-generation/languages/language.d.ts.map +1 -0
- package/dist/lib/type-generation/languages/language.js +77 -0
- package/dist/lib/type-generation/languages/language.js.map +1 -0
- package/dist/lib/type-generation/languages/php.d.ts +7 -0
- package/dist/lib/type-generation/languages/php.d.ts.map +1 -0
- package/dist/lib/type-generation/languages/php.js +116 -0
- package/dist/lib/type-generation/languages/php.js.map +1 -0
- package/dist/lib/type-generation/languages/swift.d.ts +7 -0
- package/dist/lib/type-generation/languages/swift.d.ts.map +1 -0
- package/dist/lib/type-generation/languages/swift.js +179 -0
- package/dist/lib/type-generation/languages/swift.js.map +1 -0
- package/dist/lib/type-generation/languages/typescript.d.ts +9 -0
- package/dist/lib/type-generation/languages/typescript.d.ts.map +1 -0
- package/dist/lib/type-generation/languages/typescript.js +115 -0
- package/dist/lib/type-generation/languages/typescript.js.map +1 -0
- package/dist/lib/types.d.ts +277 -0
- package/dist/lib/types.d.ts.map +1 -0
- package/dist/lib/types.js +2 -0
- package/dist/lib/types.js.map +1 -0
- package/dist/lib/utils.d.ts +15 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/{lib → dist/lib}/utils.js +125 -167
- package/dist/lib/utils.js.map +1 -0
- package/dist/lib/validations.d.ts +2 -0
- package/dist/lib/validations.d.ts.map +1 -0
- package/dist/lib/validations.js +16 -0
- package/dist/lib/validations.js.map +1 -0
- package/dist/package.json +67 -0
- package/dist/scripts/generate-commands.d.ts +2 -0
- package/dist/scripts/generate-commands.d.ts.map +1 -0
- package/dist/scripts/generate-commands.js +398 -0
- package/dist/scripts/generate-commands.js.map +1 -0
- package/index.ts +168 -0
- package/install.ps1 +2 -5
- package/install.sh +1 -2
- package/lib/client.ts +292 -0
- package/lib/commands/generic.ts +440 -0
- package/lib/commands/init.ts +713 -0
- package/lib/commands/pull.ts +668 -0
- package/lib/commands/push.ts +3183 -0
- package/lib/commands/run.ts +416 -0
- package/lib/commands/services/account.ts +832 -0
- package/lib/commands/services/avatars.ts +400 -0
- package/lib/commands/services/console.ts +73 -0
- package/lib/commands/services/databases.ts +2080 -0
- package/lib/commands/services/functions.ts +855 -0
- package/lib/commands/services/graphql.ts +47 -0
- package/lib/commands/services/health.ts +322 -0
- package/lib/commands/services/locale.ts +99 -0
- package/lib/commands/services/messaging.ts +1871 -0
- package/lib/commands/services/migrations.ts +421 -0
- package/lib/commands/services/project.ts +116 -0
- package/lib/commands/services/projects.ts +1317 -0
- package/lib/commands/services/proxy.ts +163 -0
- package/lib/commands/services/sites.ts +777 -0
- package/lib/commands/services/storage.ts +547 -0
- package/lib/commands/services/tablesdb.ts +1928 -0
- package/lib/commands/services/teams.ts +294 -0
- package/lib/commands/services/tokens.ts +106 -0
- package/lib/commands/services/users.ts +886 -0
- package/lib/commands/services/vcs.ts +268 -0
- package/lib/commands/types.ts +220 -0
- package/lib/commands/update.ts +255 -0
- package/lib/config.ts +969 -0
- package/lib/emulation/docker.ts +312 -0
- package/lib/emulation/utils.ts +207 -0
- package/lib/id.ts +30 -0
- package/lib/paginate.ts +77 -0
- package/lib/parser.ts +264 -0
- package/lib/questions.ts +1167 -0
- package/lib/sdks.ts +84 -0
- package/lib/services.ts +72 -0
- package/lib/spinner.ts +131 -0
- package/lib/type-generation/attribute.ts +18 -0
- package/lib/type-generation/languages/{csharp.js → csharp.ts} +27 -14
- package/lib/type-generation/languages/{dart.js → dart.ts} +61 -46
- package/lib/type-generation/languages/{java.js → java.ts} +31 -18
- package/lib/type-generation/languages/{javascript.js → javascript.ts} +35 -24
- package/lib/type-generation/languages/{kotlin.js → kotlin.ts} +27 -14
- package/lib/type-generation/languages/{language.js → language.ts} +45 -43
- package/lib/type-generation/languages/{php.js → php.ts} +28 -15
- package/lib/type-generation/languages/{swift.js → swift.ts} +27 -14
- package/lib/type-generation/languages/{typescript.js → typescript.ts} +43 -26
- package/lib/types.ts +304 -0
- package/lib/utils.ts +352 -0
- package/lib/validations.ts +20 -0
- package/package.json +36 -19
- package/scoop/appwrite.config.json +19 -29
- package/scripts/generate-commands.ts +539 -0
- package/tsconfig.json +24 -0
- package/.github/workflows/autoclose.yml +0 -11
- package/docs/examples/account/create-anonymous-session.md +0 -1
- package/docs/examples/account/create-email-password-session.md +0 -3
- package/docs/examples/account/create-email-token.md +0 -3
- package/docs/examples/account/create-email-verification.md +0 -2
- package/docs/examples/account/create-jwt.md +0 -1
- package/docs/examples/account/create-magic-url-token.md +0 -3
- package/docs/examples/account/create-mfa-authenticator.md +0 -2
- package/docs/examples/account/create-mfa-challenge.md +0 -2
- package/docs/examples/account/create-mfa-recovery-codes.md +0 -1
- package/docs/examples/account/create-o-auth-2-session.md +0 -2
- package/docs/examples/account/create-o-auth-2-token.md +0 -2
- package/docs/examples/account/create-phone-token.md +0 -3
- package/docs/examples/account/create-phone-verification.md +0 -1
- package/docs/examples/account/create-push-target.md +0 -3
- package/docs/examples/account/create-recovery.md +0 -3
- package/docs/examples/account/create-session.md +0 -3
- package/docs/examples/account/create-verification.md +0 -2
- package/docs/examples/account/create.md +0 -4
- package/docs/examples/account/delete-identity.md +0 -2
- package/docs/examples/account/delete-mfa-authenticator.md +0 -2
- package/docs/examples/account/delete-push-target.md +0 -2
- package/docs/examples/account/delete-session.md +0 -2
- package/docs/examples/account/delete-sessions.md +0 -1
- package/docs/examples/account/delete.md +0 -1
- package/docs/examples/account/get-mfa-recovery-codes.md +0 -1
- package/docs/examples/account/get-prefs.md +0 -1
- package/docs/examples/account/get-session.md +0 -2
- package/docs/examples/account/get.md +0 -1
- package/docs/examples/account/list-identities.md +0 -1
- package/docs/examples/account/list-logs.md +0 -1
- package/docs/examples/account/list-mfa-factors.md +0 -1
- package/docs/examples/account/list-sessions.md +0 -1
- package/docs/examples/account/update-email-verification.md +0 -3
- package/docs/examples/account/update-email.md +0 -3
- package/docs/examples/account/update-magic-url-session.md +0 -3
- package/docs/examples/account/update-mfa-authenticator.md +0 -3
- package/docs/examples/account/update-mfa-challenge.md +0 -3
- package/docs/examples/account/update-mfa-recovery-codes.md +0 -1
- package/docs/examples/account/update-mfa.md +0 -2
- package/docs/examples/account/update-name.md +0 -2
- package/docs/examples/account/update-password.md +0 -2
- package/docs/examples/account/update-phone-session.md +0 -3
- package/docs/examples/account/update-phone-verification.md +0 -3
- package/docs/examples/account/update-phone.md +0 -3
- package/docs/examples/account/update-prefs.md +0 -2
- package/docs/examples/account/update-push-target.md +0 -3
- package/docs/examples/account/update-recovery.md +0 -4
- package/docs/examples/account/update-session.md +0 -2
- package/docs/examples/account/update-status.md +0 -1
- package/docs/examples/account/update-verification.md +0 -3
- package/docs/examples/console/get-resource.md +0 -3
- package/docs/examples/console/variables.md +0 -1
- package/docs/examples/databases/create-boolean-attribute.md +0 -5
- package/docs/examples/databases/create-collection.md +0 -4
- package/docs/examples/databases/create-datetime-attribute.md +0 -5
- package/docs/examples/databases/create-document.md +0 -5
- package/docs/examples/databases/create-documents.md +0 -4
- package/docs/examples/databases/create-email-attribute.md +0 -5
- package/docs/examples/databases/create-enum-attribute.md +0 -6
- package/docs/examples/databases/create-float-attribute.md +0 -5
- package/docs/examples/databases/create-index.md +0 -6
- package/docs/examples/databases/create-integer-attribute.md +0 -5
- package/docs/examples/databases/create-ip-attribute.md +0 -5
- package/docs/examples/databases/create-line-attribute.md +0 -5
- package/docs/examples/databases/create-operations.md +0 -2
- package/docs/examples/databases/create-point-attribute.md +0 -5
- package/docs/examples/databases/create-polygon-attribute.md +0 -5
- package/docs/examples/databases/create-relationship-attribute.md +0 -5
- package/docs/examples/databases/create-string-attribute.md +0 -6
- package/docs/examples/databases/create-transaction.md +0 -1
- package/docs/examples/databases/create-url-attribute.md +0 -5
- package/docs/examples/databases/create.md +0 -3
- package/docs/examples/databases/decrement-document-attribute.md +0 -5
- package/docs/examples/databases/delete-attribute.md +0 -4
- package/docs/examples/databases/delete-collection.md +0 -3
- package/docs/examples/databases/delete-document.md +0 -4
- package/docs/examples/databases/delete-documents.md +0 -3
- package/docs/examples/databases/delete-index.md +0 -4
- package/docs/examples/databases/delete-transaction.md +0 -2
- package/docs/examples/databases/delete.md +0 -2
- package/docs/examples/databases/get-attribute.md +0 -4
- package/docs/examples/databases/get-collection-usage.md +0 -3
- package/docs/examples/databases/get-collection.md +0 -3
- package/docs/examples/databases/get-document.md +0 -4
- package/docs/examples/databases/get-index.md +0 -4
- package/docs/examples/databases/get-transaction.md +0 -2
- package/docs/examples/databases/get-usage.md +0 -2
- package/docs/examples/databases/get.md +0 -2
- package/docs/examples/databases/increment-document-attribute.md +0 -5
- package/docs/examples/databases/list-attributes.md +0 -3
- package/docs/examples/databases/list-collection-logs.md +0 -3
- package/docs/examples/databases/list-collections.md +0 -2
- package/docs/examples/databases/list-document-logs.md +0 -4
- package/docs/examples/databases/list-documents.md +0 -3
- package/docs/examples/databases/list-indexes.md +0 -3
- package/docs/examples/databases/list-logs.md +0 -2
- package/docs/examples/databases/list-transactions.md +0 -1
- package/docs/examples/databases/list-usage.md +0 -1
- package/docs/examples/databases/list.md +0 -1
- package/docs/examples/databases/update-boolean-attribute.md +0 -6
- package/docs/examples/databases/update-collection.md +0 -4
- package/docs/examples/databases/update-datetime-attribute.md +0 -6
- package/docs/examples/databases/update-document.md +0 -4
- package/docs/examples/databases/update-documents.md +0 -3
- package/docs/examples/databases/update-email-attribute.md +0 -6
- package/docs/examples/databases/update-enum-attribute.md +0 -7
- package/docs/examples/databases/update-float-attribute.md +0 -6
- package/docs/examples/databases/update-integer-attribute.md +0 -6
- package/docs/examples/databases/update-ip-attribute.md +0 -6
- package/docs/examples/databases/update-line-attribute.md +0 -5
- package/docs/examples/databases/update-point-attribute.md +0 -5
- package/docs/examples/databases/update-polygon-attribute.md +0 -5
- package/docs/examples/databases/update-relationship-attribute.md +0 -4
- package/docs/examples/databases/update-string-attribute.md +0 -6
- package/docs/examples/databases/update-transaction.md +0 -2
- package/docs/examples/databases/update-url-attribute.md +0 -6
- package/docs/examples/databases/update.md +0 -3
- package/docs/examples/databases/upsert-document.md +0 -5
- package/docs/examples/databases/upsert-documents.md +0 -4
- package/docs/examples/functions/create-deployment.md +0 -4
- package/docs/examples/functions/create-duplicate-deployment.md +0 -3
- package/docs/examples/functions/create-execution.md +0 -2
- package/docs/examples/functions/create-template-deployment.md +0 -7
- package/docs/examples/functions/create-variable.md +0 -4
- package/docs/examples/functions/create-vcs-deployment.md +0 -4
- package/docs/examples/functions/create.md +0 -4
- package/docs/examples/functions/delete-deployment.md +0 -3
- package/docs/examples/functions/delete-execution.md +0 -3
- package/docs/examples/functions/delete-variable.md +0 -3
- package/docs/examples/functions/delete.md +0 -2
- package/docs/examples/functions/get-deployment-download.md +0 -3
- package/docs/examples/functions/get-deployment.md +0 -3
- package/docs/examples/functions/get-execution.md +0 -3
- package/docs/examples/functions/get-template.md +0 -2
- package/docs/examples/functions/get-usage.md +0 -2
- package/docs/examples/functions/get-variable.md +0 -3
- package/docs/examples/functions/get.md +0 -2
- package/docs/examples/functions/list-deployments.md +0 -2
- package/docs/examples/functions/list-executions.md +0 -2
- package/docs/examples/functions/list-runtimes.md +0 -1
- package/docs/examples/functions/list-specifications.md +0 -1
- package/docs/examples/functions/list-templates.md +0 -1
- package/docs/examples/functions/list-usage.md +0 -1
- package/docs/examples/functions/list-variables.md +0 -2
- package/docs/examples/functions/list.md +0 -1
- package/docs/examples/functions/update-deployment-status.md +0 -3
- package/docs/examples/functions/update-function-deployment.md +0 -3
- package/docs/examples/functions/update-variable.md +0 -4
- package/docs/examples/functions/update.md +0 -3
- package/docs/examples/graphql/mutation.md +0 -2
- package/docs/examples/graphql/query.md +0 -2
- package/docs/examples/health/get-antivirus.md +0 -1
- package/docs/examples/health/get-cache.md +0 -1
- package/docs/examples/health/get-certificate.md +0 -1
- package/docs/examples/health/get-db.md +0 -1
- package/docs/examples/health/get-failed-jobs.md +0 -2
- package/docs/examples/health/get-pub-sub.md +0 -1
- package/docs/examples/health/get-queue-builds.md +0 -1
- package/docs/examples/health/get-queue-certificates.md +0 -1
- package/docs/examples/health/get-queue-databases.md +0 -1
- package/docs/examples/health/get-queue-deletes.md +0 -1
- package/docs/examples/health/get-queue-functions.md +0 -1
- package/docs/examples/health/get-queue-logs.md +0 -1
- package/docs/examples/health/get-queue-mails.md +0 -1
- package/docs/examples/health/get-queue-messaging.md +0 -1
- package/docs/examples/health/get-queue-migrations.md +0 -1
- package/docs/examples/health/get-queue-stats-resources.md +0 -1
- package/docs/examples/health/get-queue-usage.md +0 -1
- package/docs/examples/health/get-queue-webhooks.md +0 -1
- package/docs/examples/health/get-storage-local.md +0 -1
- package/docs/examples/health/get-storage.md +0 -1
- package/docs/examples/health/get-time.md +0 -1
- package/docs/examples/health/get.md +0 -1
- package/docs/examples/locale/get.md +0 -1
- package/docs/examples/locale/list-codes.md +0 -1
- package/docs/examples/locale/list-continents.md +0 -1
- package/docs/examples/locale/list-countries-eu.md +0 -1
- package/docs/examples/locale/list-countries-phones.md +0 -1
- package/docs/examples/locale/list-countries.md +0 -1
- package/docs/examples/locale/list-currencies.md +0 -1
- package/docs/examples/locale/list-languages.md +0 -1
- package/docs/examples/messaging/create-apns-provider.md +0 -3
- package/docs/examples/messaging/create-email.md +0 -4
- package/docs/examples/messaging/create-fcm-provider.md +0 -3
- package/docs/examples/messaging/create-mailgun-provider.md +0 -3
- package/docs/examples/messaging/create-msg-91-provider.md +0 -3
- package/docs/examples/messaging/create-push.md +0 -2
- package/docs/examples/messaging/create-resend-provider.md +0 -3
- package/docs/examples/messaging/create-sendgrid-provider.md +0 -3
- package/docs/examples/messaging/create-sms.md +0 -3
- package/docs/examples/messaging/create-smtp-provider.md +0 -4
- package/docs/examples/messaging/create-subscriber.md +0 -4
- package/docs/examples/messaging/create-telesign-provider.md +0 -3
- package/docs/examples/messaging/create-textmagic-provider.md +0 -3
- package/docs/examples/messaging/create-topic.md +0 -3
- package/docs/examples/messaging/create-twilio-provider.md +0 -3
- package/docs/examples/messaging/create-vonage-provider.md +0 -3
- package/docs/examples/messaging/delete-provider.md +0 -2
- package/docs/examples/messaging/delete-subscriber.md +0 -3
- package/docs/examples/messaging/delete-topic.md +0 -2
- package/docs/examples/messaging/delete.md +0 -2
- package/docs/examples/messaging/get-message.md +0 -2
- package/docs/examples/messaging/get-provider.md +0 -2
- package/docs/examples/messaging/get-subscriber.md +0 -3
- package/docs/examples/messaging/get-topic.md +0 -2
- package/docs/examples/messaging/list-message-logs.md +0 -2
- package/docs/examples/messaging/list-messages.md +0 -1
- package/docs/examples/messaging/list-provider-logs.md +0 -2
- package/docs/examples/messaging/list-providers.md +0 -1
- package/docs/examples/messaging/list-subscriber-logs.md +0 -2
- package/docs/examples/messaging/list-subscribers.md +0 -2
- package/docs/examples/messaging/list-targets.md +0 -2
- package/docs/examples/messaging/list-topic-logs.md +0 -2
- package/docs/examples/messaging/list-topics.md +0 -1
- package/docs/examples/messaging/update-apns-provider.md +0 -2
- package/docs/examples/messaging/update-email.md +0 -2
- package/docs/examples/messaging/update-fcm-provider.md +0 -2
- package/docs/examples/messaging/update-mailgun-provider.md +0 -2
- package/docs/examples/messaging/update-msg-91-provider.md +0 -2
- package/docs/examples/messaging/update-push.md +0 -2
- package/docs/examples/messaging/update-resend-provider.md +0 -2
- package/docs/examples/messaging/update-sendgrid-provider.md +0 -2
- package/docs/examples/messaging/update-sms.md +0 -2
- package/docs/examples/messaging/update-smtp-provider.md +0 -2
- package/docs/examples/messaging/update-telesign-provider.md +0 -2
- package/docs/examples/messaging/update-textmagic-provider.md +0 -2
- package/docs/examples/messaging/update-topic.md +0 -2
- package/docs/examples/messaging/update-twilio-provider.md +0 -2
- package/docs/examples/messaging/update-vonage-provider.md +0 -2
- package/docs/examples/migrations/create-appwrite-migration.md +0 -5
- package/docs/examples/migrations/create-csv-export.md +0 -3
- package/docs/examples/migrations/create-csv-import.md +0 -4
- package/docs/examples/migrations/create-firebase-migration.md +0 -3
- package/docs/examples/migrations/create-n-host-migration.md +0 -8
- package/docs/examples/migrations/create-supabase-migration.md +0 -7
- package/docs/examples/migrations/delete.md +0 -2
- package/docs/examples/migrations/get-appwrite-report.md +0 -5
- package/docs/examples/migrations/get-firebase-report.md +0 -3
- package/docs/examples/migrations/get-n-host-report.md +0 -8
- package/docs/examples/migrations/get-supabase-report.md +0 -7
- package/docs/examples/migrations/get.md +0 -2
- package/docs/examples/migrations/list.md +0 -1
- package/docs/examples/migrations/retry.md +0 -2
- package/docs/examples/project/create-variable.md +0 -3
- package/docs/examples/project/delete-variable.md +0 -2
- package/docs/examples/project/get-usage.md +0 -3
- package/docs/examples/project/get-variable.md +0 -2
- package/docs/examples/project/list-variables.md +0 -1
- package/docs/examples/project/update-variable.md +0 -3
- package/docs/examples/projects/create-dev-key.md +0 -4
- package/docs/examples/projects/create-jwt.md +0 -3
- package/docs/examples/projects/create-key.md +0 -4
- package/docs/examples/projects/create-platform.md +0 -4
- package/docs/examples/projects/create-smtp-test.md +0 -6
- package/docs/examples/projects/create-webhook.md +0 -6
- package/docs/examples/projects/create.md +0 -4
- package/docs/examples/projects/delete-dev-key.md +0 -3
- package/docs/examples/projects/delete-email-template.md +0 -4
- package/docs/examples/projects/delete-key.md +0 -3
- package/docs/examples/projects/delete-platform.md +0 -3
- package/docs/examples/projects/delete-sms-template.md +0 -4
- package/docs/examples/projects/delete-webhook.md +0 -3
- package/docs/examples/projects/delete.md +0 -2
- package/docs/examples/projects/get-dev-key.md +0 -3
- package/docs/examples/projects/get-email-template.md +0 -4
- package/docs/examples/projects/get-key.md +0 -3
- package/docs/examples/projects/get-platform.md +0 -3
- package/docs/examples/projects/get-sms-template.md +0 -4
- package/docs/examples/projects/get-webhook.md +0 -3
- package/docs/examples/projects/get.md +0 -2
- package/docs/examples/projects/list-dev-keys.md +0 -2
- package/docs/examples/projects/list-keys.md +0 -2
- package/docs/examples/projects/list-platforms.md +0 -2
- package/docs/examples/projects/list-webhooks.md +0 -2
- package/docs/examples/projects/list.md +0 -1
- package/docs/examples/projects/update-api-status-all.md +0 -3
- package/docs/examples/projects/update-api-status.md +0 -4
- package/docs/examples/projects/update-auth-duration.md +0 -3
- package/docs/examples/projects/update-auth-limit.md +0 -3
- package/docs/examples/projects/update-auth-password-dictionary.md +0 -3
- package/docs/examples/projects/update-auth-password-history.md +0 -3
- package/docs/examples/projects/update-auth-sessions-limit.md +0 -3
- package/docs/examples/projects/update-auth-status.md +0 -4
- package/docs/examples/projects/update-dev-key.md +0 -5
- package/docs/examples/projects/update-email-template.md +0 -6
- package/docs/examples/projects/update-key.md +0 -5
- package/docs/examples/projects/update-memberships-privacy.md +0 -5
- package/docs/examples/projects/update-mock-numbers.md +0 -3
- package/docs/examples/projects/update-o-auth-2.md +0 -3
- package/docs/examples/projects/update-personal-data-check.md +0 -3
- package/docs/examples/projects/update-platform.md +0 -4
- package/docs/examples/projects/update-service-status-all.md +0 -3
- package/docs/examples/projects/update-service-status.md +0 -4
- package/docs/examples/projects/update-session-alerts.md +0 -3
- package/docs/examples/projects/update-session-invalidation.md +0 -3
- package/docs/examples/projects/update-sms-template.md +0 -5
- package/docs/examples/projects/update-smtp.md +0 -3
- package/docs/examples/projects/update-team.md +0 -3
- package/docs/examples/projects/update-webhook-signature.md +0 -3
- package/docs/examples/projects/update-webhook.md +0 -7
- package/docs/examples/projects/update.md +0 -3
- package/docs/examples/proxy/create-api-rule.md +0 -2
- package/docs/examples/proxy/create-function-rule.md +0 -3
- package/docs/examples/proxy/create-redirect-rule.md +0 -6
- package/docs/examples/proxy/create-site-rule.md +0 -3
- package/docs/examples/proxy/delete-rule.md +0 -2
- package/docs/examples/proxy/get-rule.md +0 -2
- package/docs/examples/proxy/list-rules.md +0 -1
- package/docs/examples/proxy/update-rule-verification.md +0 -2
- package/docs/examples/sites/create-deployment.md +0 -4
- package/docs/examples/sites/create-duplicate-deployment.md +0 -3
- package/docs/examples/sites/create-template-deployment.md +0 -7
- package/docs/examples/sites/create-variable.md +0 -4
- package/docs/examples/sites/create-vcs-deployment.md +0 -4
- package/docs/examples/sites/create.md +0 -5
- package/docs/examples/sites/delete-deployment.md +0 -3
- package/docs/examples/sites/delete-log.md +0 -3
- package/docs/examples/sites/delete-variable.md +0 -3
- package/docs/examples/sites/delete.md +0 -2
- package/docs/examples/sites/get-deployment-download.md +0 -3
- package/docs/examples/sites/get-deployment.md +0 -3
- package/docs/examples/sites/get-log.md +0 -3
- package/docs/examples/sites/get-template.md +0 -2
- package/docs/examples/sites/get-usage.md +0 -2
- package/docs/examples/sites/get-variable.md +0 -3
- package/docs/examples/sites/get.md +0 -2
- package/docs/examples/sites/list-deployments.md +0 -2
- package/docs/examples/sites/list-frameworks.md +0 -1
- package/docs/examples/sites/list-logs.md +0 -2
- package/docs/examples/sites/list-specifications.md +0 -1
- package/docs/examples/sites/list-templates.md +0 -1
- package/docs/examples/sites/list-usage.md +0 -1
- package/docs/examples/sites/list-variables.md +0 -2
- package/docs/examples/sites/list.md +0 -1
- package/docs/examples/sites/update-deployment-status.md +0 -3
- package/docs/examples/sites/update-site-deployment.md +0 -3
- package/docs/examples/sites/update-variable.md +0 -4
- package/docs/examples/sites/update.md +0 -4
- package/docs/examples/storage/create-bucket.md +0 -3
- package/docs/examples/storage/create-file.md +0 -4
- package/docs/examples/storage/delete-bucket.md +0 -2
- package/docs/examples/storage/delete-file.md +0 -3
- package/docs/examples/storage/get-bucket-usage.md +0 -2
- package/docs/examples/storage/get-bucket.md +0 -2
- package/docs/examples/storage/get-file-download.md +0 -3
- package/docs/examples/storage/get-file-preview.md +0 -3
- package/docs/examples/storage/get-file-view.md +0 -3
- package/docs/examples/storage/get-file.md +0 -3
- package/docs/examples/storage/get-usage.md +0 -1
- package/docs/examples/storage/list-buckets.md +0 -1
- package/docs/examples/storage/list-files.md +0 -2
- package/docs/examples/storage/update-bucket.md +0 -3
- package/docs/examples/storage/update-file.md +0 -3
- package/docs/examples/tablesdb/create-boolean-column.md +0 -5
- package/docs/examples/tablesdb/create-datetime-column.md +0 -5
- package/docs/examples/tablesdb/create-email-column.md +0 -5
- package/docs/examples/tablesdb/create-enum-column.md +0 -6
- package/docs/examples/tablesdb/create-float-column.md +0 -5
- package/docs/examples/tablesdb/create-index.md +0 -6
- package/docs/examples/tablesdb/create-integer-column.md +0 -5
- package/docs/examples/tablesdb/create-ip-column.md +0 -5
- package/docs/examples/tablesdb/create-line-column.md +0 -5
- package/docs/examples/tablesdb/create-operations.md +0 -2
- package/docs/examples/tablesdb/create-point-column.md +0 -5
- package/docs/examples/tablesdb/create-polygon-column.md +0 -5
- package/docs/examples/tablesdb/create-relationship-column.md +0 -5
- package/docs/examples/tablesdb/create-row.md +0 -5
- package/docs/examples/tablesdb/create-rows.md +0 -4
- package/docs/examples/tablesdb/create-string-column.md +0 -6
- package/docs/examples/tablesdb/create-table.md +0 -4
- package/docs/examples/tablesdb/create-transaction.md +0 -1
- package/docs/examples/tablesdb/create-url-column.md +0 -5
- package/docs/examples/tablesdb/create.md +0 -3
- package/docs/examples/tablesdb/decrement-row-column.md +0 -5
- package/docs/examples/tablesdb/delete-column.md +0 -4
- package/docs/examples/tablesdb/delete-index.md +0 -4
- package/docs/examples/tablesdb/delete-row.md +0 -4
- package/docs/examples/tablesdb/delete-rows.md +0 -3
- package/docs/examples/tablesdb/delete-table.md +0 -3
- package/docs/examples/tablesdb/delete-transaction.md +0 -2
- package/docs/examples/tablesdb/delete.md +0 -2
- package/docs/examples/tablesdb/get-column.md +0 -4
- package/docs/examples/tablesdb/get-index.md +0 -4
- package/docs/examples/tablesdb/get-row.md +0 -4
- package/docs/examples/tablesdb/get-table-usage.md +0 -3
- package/docs/examples/tablesdb/get-table.md +0 -3
- package/docs/examples/tablesdb/get-transaction.md +0 -2
- package/docs/examples/tablesdb/get-usage.md +0 -2
- package/docs/examples/tablesdb/get.md +0 -2
- package/docs/examples/tablesdb/increment-row-column.md +0 -5
- package/docs/examples/tablesdb/list-columns.md +0 -3
- package/docs/examples/tablesdb/list-indexes.md +0 -3
- package/docs/examples/tablesdb/list-row-logs.md +0 -4
- package/docs/examples/tablesdb/list-rows.md +0 -3
- package/docs/examples/tablesdb/list-table-logs.md +0 -3
- package/docs/examples/tablesdb/list-tables.md +0 -2
- package/docs/examples/tablesdb/list-transactions.md +0 -1
- package/docs/examples/tablesdb/list-usage.md +0 -1
- package/docs/examples/tablesdb/list.md +0 -1
- package/docs/examples/tablesdb/update-boolean-column.md +0 -6
- package/docs/examples/tablesdb/update-datetime-column.md +0 -6
- package/docs/examples/tablesdb/update-email-column.md +0 -6
- package/docs/examples/tablesdb/update-enum-column.md +0 -7
- package/docs/examples/tablesdb/update-float-column.md +0 -6
- package/docs/examples/tablesdb/update-integer-column.md +0 -6
- package/docs/examples/tablesdb/update-ip-column.md +0 -6
- package/docs/examples/tablesdb/update-line-column.md +0 -5
- package/docs/examples/tablesdb/update-point-column.md +0 -5
- package/docs/examples/tablesdb/update-polygon-column.md +0 -5
- package/docs/examples/tablesdb/update-relationship-column.md +0 -4
- package/docs/examples/tablesdb/update-row.md +0 -4
- package/docs/examples/tablesdb/update-rows.md +0 -3
- package/docs/examples/tablesdb/update-string-column.md +0 -6
- package/docs/examples/tablesdb/update-table.md +0 -4
- package/docs/examples/tablesdb/update-transaction.md +0 -2
- package/docs/examples/tablesdb/update-url-column.md +0 -6
- package/docs/examples/tablesdb/update.md +0 -3
- package/docs/examples/tablesdb/upsert-row.md +0 -4
- package/docs/examples/tablesdb/upsert-rows.md +0 -4
- package/docs/examples/teams/create-membership.md +0 -3
- package/docs/examples/teams/create.md +0 -3
- package/docs/examples/teams/delete-membership.md +0 -3
- package/docs/examples/teams/delete.md +0 -2
- package/docs/examples/teams/get-membership.md +0 -3
- package/docs/examples/teams/get-prefs.md +0 -2
- package/docs/examples/teams/get.md +0 -2
- package/docs/examples/teams/list-logs.md +0 -2
- package/docs/examples/teams/list-memberships.md +0 -2
- package/docs/examples/teams/list.md +0 -1
- package/docs/examples/teams/update-membership-status.md +0 -5
- package/docs/examples/teams/update-membership.md +0 -4
- package/docs/examples/teams/update-name.md +0 -3
- package/docs/examples/teams/update-prefs.md +0 -3
- package/docs/examples/tokens/create-file-token.md +0 -3
- package/docs/examples/tokens/delete.md +0 -2
- package/docs/examples/tokens/get.md +0 -2
- package/docs/examples/tokens/list.md +0 -3
- package/docs/examples/tokens/update.md +0 -2
- package/docs/examples/users/create-argon-2-user.md +0 -4
- package/docs/examples/users/create-bcrypt-user.md +0 -4
- package/docs/examples/users/create-jwt.md +0 -2
- package/docs/examples/users/create-md-5-user.md +0 -4
- package/docs/examples/users/create-mfa-recovery-codes.md +0 -2
- package/docs/examples/users/create-ph-pass-user.md +0 -4
- package/docs/examples/users/create-scrypt-modified-user.md +0 -7
- package/docs/examples/users/create-scrypt-user.md +0 -9
- package/docs/examples/users/create-session.md +0 -2
- package/docs/examples/users/create-sha-user.md +0 -4
- package/docs/examples/users/create-target.md +0 -5
- package/docs/examples/users/create-token.md +0 -2
- package/docs/examples/users/create.md +0 -2
- package/docs/examples/users/delete-identity.md +0 -2
- package/docs/examples/users/delete-mfa-authenticator.md +0 -3
- package/docs/examples/users/delete-session.md +0 -3
- package/docs/examples/users/delete-sessions.md +0 -2
- package/docs/examples/users/delete-target.md +0 -3
- package/docs/examples/users/delete.md +0 -2
- package/docs/examples/users/get-mfa-recovery-codes.md +0 -2
- package/docs/examples/users/get-prefs.md +0 -2
- package/docs/examples/users/get-target.md +0 -3
- package/docs/examples/users/get-usage.md +0 -1
- package/docs/examples/users/get.md +0 -2
- package/docs/examples/users/list-identities.md +0 -1
- package/docs/examples/users/list-logs.md +0 -2
- package/docs/examples/users/list-memberships.md +0 -2
- package/docs/examples/users/list-mfa-factors.md +0 -2
- package/docs/examples/users/list-sessions.md +0 -2
- package/docs/examples/users/list-targets.md +0 -2
- package/docs/examples/users/list.md +0 -1
- package/docs/examples/users/update-email-verification.md +0 -3
- package/docs/examples/users/update-email.md +0 -3
- package/docs/examples/users/update-labels.md +0 -3
- package/docs/examples/users/update-mfa-recovery-codes.md +0 -2
- package/docs/examples/users/update-mfa.md +0 -3
- package/docs/examples/users/update-name.md +0 -3
- package/docs/examples/users/update-password.md +0 -3
- package/docs/examples/users/update-phone-verification.md +0 -3
- package/docs/examples/users/update-phone.md +0 -3
- package/docs/examples/users/update-prefs.md +0 -3
- package/docs/examples/users/update-status.md +0 -3
- package/docs/examples/users/update-target.md +0 -3
- package/docs/examples/vcs/create-repository-detection.md +0 -4
- package/docs/examples/vcs/create-repository.md +0 -4
- package/docs/examples/vcs/delete-installation.md +0 -2
- package/docs/examples/vcs/get-installation.md +0 -2
- package/docs/examples/vcs/get-repository-contents.md +0 -3
- package/docs/examples/vcs/get-repository.md +0 -3
- package/docs/examples/vcs/list-installations.md +0 -1
- package/docs/examples/vcs/list-repositories.md +0 -3
- package/docs/examples/vcs/list-repository-branches.md +0 -3
- package/docs/examples/vcs/update-external-deployments.md +0 -4
- package/index.js +0 -147
- package/lib/client.js +0 -254
- package/lib/commands/account.js +0 -2121
- package/lib/commands/console.js +0 -127
- package/lib/commands/databases.js +0 -3590
- package/lib/commands/functions.js +0 -1732
- package/lib/commands/generic.js +0 -330
- package/lib/commands/graphql.js +0 -126
- package/lib/commands/health.js +0 -869
- package/lib/commands/locale.js +0 -316
- package/lib/commands/messaging.js +0 -3116
- package/lib/commands/migrations.js +0 -830
- package/lib/commands/organizations.js +0 -48
- package/lib/commands/project.js +0 -302
- package/lib/commands/projects.js +0 -2626
- package/lib/commands/proxy.js +0 -403
- package/lib/commands/push.js +0 -2570
- package/lib/commands/sites.js +0 -1654
- package/lib/commands/storage.js +0 -995
- package/lib/commands/tables-db.js +0 -3569
- package/lib/commands/teams.js +0 -683
- package/lib/commands/tokens.js +0 -261
- package/lib/commands/types.js +0 -191
- package/lib/commands/users.js +0 -2022
- package/lib/commands/vcs.js +0 -484
- package/lib/emulation/docker.js +0 -264
- package/lib/exception.js +0 -9
- package/lib/parser.js +0 -250
- package/lib/sdks.js +0 -60
- package/lib/spinner.js +0 -104
- package/lib/validations.js +0 -17
|
@@ -1,114 +1,114 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import path from "path";
|
|
3
|
+
import net from "net";
|
|
4
|
+
import childProcess from "child_process";
|
|
5
|
+
import chalk from "chalk";
|
|
6
|
+
import { fetch } from "undici";
|
|
7
|
+
import { localConfig, globalConfig } from "./config.js";
|
|
9
8
|
/**
|
|
10
9
|
* Get the latest version from npm registry
|
|
11
10
|
*/
|
|
12
|
-
async function getLatestVersion() {
|
|
11
|
+
export async function getLatestVersion() {
|
|
13
12
|
try {
|
|
14
|
-
const response = await fetch(
|
|
13
|
+
const response = await fetch("https://registry.npmjs.org/appwrite-cli/latest");
|
|
15
14
|
if (!response.ok) {
|
|
16
15
|
throw new Error(`HTTP ${response.status}`);
|
|
17
16
|
}
|
|
18
|
-
const data = await response.json();
|
|
17
|
+
const data = (await response.json());
|
|
19
18
|
return data.version;
|
|
20
|
-
}
|
|
19
|
+
}
|
|
20
|
+
catch (e) {
|
|
21
21
|
throw new Error(`Failed to fetch latest version: ${e.message}`);
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
-
|
|
25
24
|
/**
|
|
26
25
|
* Compare versions using semantic versioning
|
|
27
26
|
*/
|
|
28
|
-
function compareVersions(current, latest) {
|
|
29
|
-
const currentParts = current.split(
|
|
30
|
-
const latestParts = latest.split(
|
|
31
|
-
|
|
27
|
+
export function compareVersions(current, latest) {
|
|
28
|
+
const currentParts = current.split(".").map(Number);
|
|
29
|
+
const latestParts = latest.split(".").map(Number);
|
|
32
30
|
for (let i = 0; i < Math.max(currentParts.length, latestParts.length); i++) {
|
|
33
31
|
const currentPart = currentParts[i] || 0;
|
|
34
32
|
const latestPart = latestParts[i] || 0;
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
if (latestPart < currentPart)
|
|
33
|
+
if (latestPart > currentPart)
|
|
34
|
+
return 1; // Latest is newer
|
|
35
|
+
if (latestPart < currentPart)
|
|
36
|
+
return -1; // Current is newer
|
|
38
37
|
}
|
|
39
|
-
|
|
40
38
|
return 0; // Same version
|
|
41
39
|
}
|
|
42
|
-
|
|
43
|
-
function getAllFiles(folder) {
|
|
40
|
+
export function getAllFiles(folder) {
|
|
44
41
|
const files = [];
|
|
45
42
|
for (const pathDir of fs.readdirSync(folder)) {
|
|
46
43
|
const pathAbsolute = path.join(folder, pathDir);
|
|
47
44
|
let stats;
|
|
48
45
|
try {
|
|
49
46
|
stats = fs.statSync(pathAbsolute);
|
|
50
|
-
}
|
|
47
|
+
}
|
|
48
|
+
catch (error) {
|
|
51
49
|
continue;
|
|
52
50
|
}
|
|
53
51
|
if (stats.isDirectory()) {
|
|
54
52
|
files.push(...getAllFiles(pathAbsolute));
|
|
55
|
-
}
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
56
55
|
files.push(pathAbsolute);
|
|
57
56
|
}
|
|
58
57
|
}
|
|
59
58
|
return files;
|
|
60
59
|
}
|
|
61
|
-
|
|
62
|
-
async function isPortTaken(port) {
|
|
60
|
+
export async function isPortTaken(port) {
|
|
63
61
|
const taken = await new Promise((res, rej) => {
|
|
64
|
-
const tester = net
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
62
|
+
const tester = net
|
|
63
|
+
.createServer()
|
|
64
|
+
.once("error", function (err) {
|
|
65
|
+
if (err.code != "EADDRINUSE")
|
|
66
|
+
return rej(err);
|
|
67
|
+
res(true);
|
|
68
|
+
})
|
|
69
|
+
.once("listening", function () {
|
|
70
|
+
tester
|
|
71
|
+
.once("close", function () {
|
|
72
|
+
res(false);
|
|
72
73
|
})
|
|
74
|
+
.close();
|
|
75
|
+
})
|
|
73
76
|
.listen(port);
|
|
74
77
|
});
|
|
75
|
-
|
|
76
78
|
return taken;
|
|
77
79
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
80
|
+
export function systemHasCommand(command) {
|
|
81
|
+
const isUsingWindows = process.platform == "win32";
|
|
82
|
+
try {
|
|
83
|
+
if (isUsingWindows) {
|
|
84
|
+
childProcess.execSync("where " + command, { stdio: "pipe" });
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
childProcess.execSync(`[[ $(${command} --version) ]] || { exit 1; } && echo "OK"`, {
|
|
88
|
+
stdio: "pipe",
|
|
89
|
+
shell: "/bin/bash",
|
|
90
|
+
});
|
|
87
91
|
}
|
|
88
|
-
}
|
|
92
|
+
}
|
|
93
|
+
catch (error) {
|
|
89
94
|
console.log(error);
|
|
90
95
|
return false;
|
|
91
96
|
}
|
|
92
|
-
|
|
93
97
|
return true;
|
|
94
98
|
}
|
|
95
|
-
|
|
96
|
-
const checkDeployConditions = (localConfig) => {
|
|
99
|
+
export const checkDeployConditions = (localConfig) => {
|
|
97
100
|
if (Object.keys(localConfig.data).length === 0) {
|
|
98
101
|
throw new Error("No appwrite.config.json file found in the current directory. Please run this command again in the folder containing your appwrite.config.json file, or run 'appwrite init project' to link current directory to an Appwrite project.");
|
|
99
102
|
}
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
function showConsoleLink(serviceName, action, ...ids) {
|
|
103
|
+
};
|
|
104
|
+
export function showConsoleLink(serviceName, action, ...ids) {
|
|
103
105
|
const projectId = localConfig.getProject().projectId;
|
|
104
|
-
|
|
105
|
-
const url = new URL(globalConfig.getEndpoint().replace('/v1', '/console'));
|
|
106
|
+
const url = new URL(globalConfig.getEndpoint().replace("/v1", "/console"));
|
|
106
107
|
url.pathname += `/project-${projectId}`;
|
|
107
108
|
action = action.toLowerCase();
|
|
108
|
-
|
|
109
109
|
switch (serviceName) {
|
|
110
110
|
case "account":
|
|
111
|
-
url.pathname = url.pathname.replace(`/project-${projectId}`,
|
|
111
|
+
url.pathname = url.pathname.replace(`/project-${projectId}`, "");
|
|
112
112
|
url.pathname += getAccountPath(action);
|
|
113
113
|
break;
|
|
114
114
|
case "databases":
|
|
@@ -121,7 +121,7 @@ function showConsoleLink(serviceName, action, ...ids) {
|
|
|
121
121
|
url.pathname += getMessagingPath(action, ids);
|
|
122
122
|
break;
|
|
123
123
|
case "projects":
|
|
124
|
-
url.pathname = url.pathname.replace(`/project-${projectId}`,
|
|
124
|
+
url.pathname = url.pathname.replace(`/project-${projectId}`, "");
|
|
125
125
|
url.pathname += getProjectsPath(action, ids);
|
|
126
126
|
break;
|
|
127
127
|
case "storage":
|
|
@@ -139,188 +139,146 @@ function showConsoleLink(serviceName, action, ...ids) {
|
|
|
139
139
|
default:
|
|
140
140
|
return;
|
|
141
141
|
}
|
|
142
|
-
|
|
143
|
-
console.log(`${chalk.green.bold("✓ Success:")} ${chalk.green(url)}`);
|
|
142
|
+
console.log(`${chalk.green.bold("✓ Success:")} ${chalk.green(url.toString())}`);
|
|
144
143
|
}
|
|
145
|
-
|
|
146
144
|
function getAccountPath(action) {
|
|
147
|
-
let path =
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
path += '/sessions';
|
|
145
|
+
let path = "/account";
|
|
146
|
+
if (action === "listsessions") {
|
|
147
|
+
path += "/sessions";
|
|
151
148
|
}
|
|
152
|
-
|
|
153
149
|
return path;
|
|
154
150
|
}
|
|
155
|
-
|
|
156
151
|
function getDatabasePath(action, ids) {
|
|
157
|
-
let path =
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
152
|
+
let path = "/databases";
|
|
153
|
+
if ([
|
|
154
|
+
"get",
|
|
155
|
+
"listcollections",
|
|
156
|
+
"getcollection",
|
|
157
|
+
"listattributes",
|
|
158
|
+
"listdocuments",
|
|
159
|
+
"getdocument",
|
|
160
|
+
"listindexes",
|
|
161
|
+
"getdatabaseusage",
|
|
162
|
+
].includes(action)) {
|
|
161
163
|
path += `/database-${ids[0]}`;
|
|
162
164
|
}
|
|
163
|
-
|
|
164
|
-
if (action === 'getdatabaseusage') {
|
|
165
|
+
if (action === "getdatabaseusage") {
|
|
165
166
|
path += `/usage`;
|
|
166
167
|
}
|
|
167
|
-
|
|
168
|
-
|
|
168
|
+
if ([
|
|
169
|
+
"getcollection",
|
|
170
|
+
"listattributes",
|
|
171
|
+
"listdocuments",
|
|
172
|
+
"getdocument",
|
|
173
|
+
"listindexes",
|
|
174
|
+
].includes(action)) {
|
|
169
175
|
path += `/collection-${ids[1]}`;
|
|
170
176
|
}
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
path += '/attributes';
|
|
177
|
+
if (action === "listattributes") {
|
|
178
|
+
path += "/attributes";
|
|
174
179
|
}
|
|
175
|
-
if (action ===
|
|
176
|
-
path +=
|
|
180
|
+
if (action === "listindexes") {
|
|
181
|
+
path += "/indexes";
|
|
177
182
|
}
|
|
178
|
-
if (action ===
|
|
183
|
+
if (action === "getdocument") {
|
|
179
184
|
path += `/document-${ids[2]}`;
|
|
180
185
|
}
|
|
181
|
-
|
|
182
|
-
|
|
183
186
|
return path;
|
|
184
187
|
}
|
|
185
|
-
|
|
186
188
|
function getFunctionsPath(action, ids) {
|
|
187
|
-
let path =
|
|
188
|
-
|
|
189
|
-
if (action !== 'list') {
|
|
189
|
+
let path = "/functions";
|
|
190
|
+
if (action !== "list") {
|
|
190
191
|
path += `/function-${ids[0]}`;
|
|
191
192
|
}
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
path += `/deployment-${ids[1]}`
|
|
193
|
+
if (action === "getdeployment") {
|
|
194
|
+
path += `/deployment-${ids[1]}`;
|
|
195
195
|
}
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
path += `/executions`
|
|
196
|
+
if (action === "getexecution" || action === "listexecution") {
|
|
197
|
+
path += `/executions`;
|
|
199
198
|
}
|
|
200
|
-
if (action ===
|
|
201
|
-
path += `/usage
|
|
199
|
+
if (action === "getfunctionusage") {
|
|
200
|
+
path += `/usage`;
|
|
202
201
|
}
|
|
203
|
-
|
|
204
202
|
return path;
|
|
205
203
|
}
|
|
206
|
-
|
|
207
204
|
function getMessagingPath(action, ids) {
|
|
208
|
-
let path =
|
|
209
|
-
|
|
210
|
-
if (['getmessage', 'listmessagelogs'].includes(action)) {
|
|
205
|
+
let path = "/messaging";
|
|
206
|
+
if (["getmessage", "listmessagelogs"].includes(action)) {
|
|
211
207
|
path += `/message-${ids[0]}`;
|
|
212
208
|
}
|
|
213
|
-
|
|
214
|
-
if (['listproviders', 'getprovider'].includes(action)) {
|
|
209
|
+
if (["listproviders", "getprovider"].includes(action)) {
|
|
215
210
|
path += `/providers`;
|
|
216
211
|
}
|
|
217
|
-
|
|
218
|
-
if (action === 'getprovider') {
|
|
212
|
+
if (action === "getprovider") {
|
|
219
213
|
path += `/provider-${ids[0]}`;
|
|
220
214
|
}
|
|
221
|
-
|
|
222
|
-
if (['listtopics', 'gettopic'].includes(action)) {
|
|
215
|
+
if (["listtopics", "gettopic"].includes(action)) {
|
|
223
216
|
path += `/topics`;
|
|
224
217
|
}
|
|
225
|
-
|
|
226
|
-
if (action === 'gettopic') {
|
|
218
|
+
if (action === "gettopic") {
|
|
227
219
|
path += `/topic-${ids[0]}`;
|
|
228
220
|
}
|
|
229
|
-
|
|
230
221
|
return path;
|
|
231
222
|
}
|
|
232
|
-
|
|
233
223
|
function getProjectsPath(action, ids) {
|
|
234
|
-
let path =
|
|
235
|
-
|
|
236
|
-
if (action !== 'list') {
|
|
224
|
+
let path = "";
|
|
225
|
+
if (action !== "list") {
|
|
237
226
|
path += `/project-${ids[0]}`;
|
|
238
227
|
}
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
path += '/overview/keys'
|
|
228
|
+
if (["listkeys", "getkey"].includes(action)) {
|
|
229
|
+
path += "/overview/keys";
|
|
242
230
|
}
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
path += '/overview/platforms'
|
|
231
|
+
if (["listplatforms", "getplatform"].includes(action)) {
|
|
232
|
+
path += "/overview/platforms";
|
|
246
233
|
}
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
path += '/settings/webhooks'
|
|
234
|
+
if (["listwebhooks", "getwebhook"].includes(action)) {
|
|
235
|
+
path += "/settings/webhooks";
|
|
250
236
|
}
|
|
251
|
-
|
|
252
|
-
if (['getplatform', 'getkey', 'getwebhook'].includes(action)) {
|
|
237
|
+
if (["getplatform", "getkey", "getwebhook"].includes(action)) {
|
|
253
238
|
path += `/${ids[1]}`;
|
|
254
239
|
}
|
|
255
|
-
|
|
256
240
|
return path;
|
|
257
241
|
}
|
|
258
|
-
|
|
259
242
|
function getBucketsPath(action, ids) {
|
|
260
|
-
let path =
|
|
261
|
-
|
|
262
|
-
if (action !== 'listbuckets') {
|
|
243
|
+
let path = "/storage";
|
|
244
|
+
if (action !== "listbuckets") {
|
|
263
245
|
path += `/bucket-${ids[0]}`;
|
|
264
246
|
}
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
path += `/usage`
|
|
247
|
+
if (action === "getbucketusage") {
|
|
248
|
+
path += `/usage`;
|
|
268
249
|
}
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
path += `/file-${ids[1]}`
|
|
250
|
+
if (action === "getfile") {
|
|
251
|
+
path += `/file-${ids[1]}`;
|
|
272
252
|
}
|
|
273
|
-
|
|
274
253
|
return path;
|
|
275
254
|
}
|
|
276
|
-
|
|
277
255
|
function getTeamsPath(action, ids) {
|
|
278
|
-
let path =
|
|
279
|
-
|
|
280
|
-
if (action !== 'list') {
|
|
256
|
+
let path = "/auth/teams";
|
|
257
|
+
if (action !== "list") {
|
|
281
258
|
path += `/team-${ids[0]}`;
|
|
282
259
|
}
|
|
283
|
-
|
|
284
260
|
return path;
|
|
285
261
|
}
|
|
286
|
-
|
|
287
262
|
function getOrganizationsPath(action, ids) {
|
|
288
263
|
let path = `/organization-${ids[0]}`;
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
path = '/account/organizations';
|
|
264
|
+
if (action === "list") {
|
|
265
|
+
path = "/account/organizations";
|
|
292
266
|
}
|
|
293
|
-
|
|
294
267
|
return path;
|
|
295
268
|
}
|
|
296
|
-
|
|
297
269
|
function getUsersPath(action, ids) {
|
|
298
|
-
let path =
|
|
299
|
-
|
|
300
|
-
if (action !== 'list') {
|
|
270
|
+
let path = "/auth";
|
|
271
|
+
if (action !== "list") {
|
|
301
272
|
path += `/user-${ids[0]}`;
|
|
302
273
|
}
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
path += 'sessions';
|
|
274
|
+
if (action === "listsessions") {
|
|
275
|
+
path += "sessions";
|
|
306
276
|
}
|
|
307
|
-
|
|
308
277
|
return path;
|
|
309
278
|
}
|
|
310
|
-
|
|
311
|
-
function isCloud() {
|
|
279
|
+
export function isCloud() {
|
|
312
280
|
const endpoint = globalConfig.getEndpoint() || "https://cloud.appwrite.io/v1";
|
|
313
281
|
const hostname = new URL(endpoint).hostname;
|
|
314
|
-
return hostname.endsWith(
|
|
282
|
+
return hostname.endsWith("appwrite.io");
|
|
315
283
|
}
|
|
316
|
-
|
|
317
|
-
module.exports = {
|
|
318
|
-
getAllFiles,
|
|
319
|
-
isPortTaken,
|
|
320
|
-
systemHasCommand,
|
|
321
|
-
checkDeployConditions,
|
|
322
|
-
showConsoleLink,
|
|
323
|
-
isCloud,
|
|
324
|
-
getLatestVersion,
|
|
325
|
-
compareVersions
|
|
326
|
-
};
|
|
284
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../lib/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,YAAY,MAAM,eAAe,CAAC;AACzC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAExD;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB;IACpC,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,KAAK,CAC1B,gDAAgD,CACjD,CAAC;QACF,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YACjB,MAAM,IAAI,KAAK,CAAC,QAAQ,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;QAC7C,CAAC;QACD,MAAM,IAAI,GAAG,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAwB,CAAC;QAC5D,OAAO,IAAI,CAAC,OAAO,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AC;IAErC,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;QACtB,IAAI,GAAG,wBAAwB,CAAC;IAClC,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,YAAY,CAAC,MAAc,EAAE,GAAa;IACjD,IAAI,IAAI,GAAG,OAAO,CAAC;IAEnB,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;QACtB,IAAI,IAAI,SAAS,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;IAC5B,CAAC;IAED,IAAI,MAAM,KAAK,cAAc,EAAE,CAAC;QAC9B,IAAI,IAAI,UAAU,CAAC;IACrB,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAM,UAAU,OAAO;IACrB,MAAM,QAAQ,GAAG,YAAY,CAAC,WAAW,EAAE,IAAI,8BAA8B,CAAC;IAC9E,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC;IAC5C,OAAO,QAAQ,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;AAC1C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validations.d.ts","sourceRoot":"","sources":["../../lib/validations.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,GAC3B,UAAU,MAAM,EAChB,OAAO,GAAG,KACT,MAAM,GAAG,IAgBX,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export const validateRequired = (resource, value) => {
|
|
2
|
+
if (Array.isArray(value)) {
|
|
3
|
+
if (value.length <= 0) {
|
|
4
|
+
return `Please select at least one ${resource}`;
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
else {
|
|
8
|
+
if (value === undefined ||
|
|
9
|
+
value === null ||
|
|
10
|
+
(typeof value === "string" && value.trim() === "")) {
|
|
11
|
+
return `${resource} is required`;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
return true;
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=validations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validations.js","sourceRoot":"","sources":["../../lib/validations.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAC9B,QAAgB,EAChB,KAAU,EACK,EAAE;IACjB,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,IAAI,KAAK,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC;YACtB,OAAO,8BAA8B,QAAQ,EAAE,CAAC;QAClD,CAAC;IACH,CAAC;SAAM,CAAC;QACN,IACE,KAAK,KAAK,SAAS;YACnB,KAAK,KAAK,IAAI;YACd,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,EAClD,CAAC;YACD,OAAO,GAAG,QAAQ,cAAc,CAAC;QACnC,CAAC;IACH,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "appwrite-cli",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"homepage": "https://appwrite.io/support",
|
|
5
|
+
"description": "Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API",
|
|
6
|
+
"version": "13.0.0-rc.2",
|
|
7
|
+
"license": "BSD-3-Clause",
|
|
8
|
+
"main": "dist/index.js",
|
|
9
|
+
"types": "dist/index.d.ts",
|
|
10
|
+
"bin": {
|
|
11
|
+
"appwrite": "dist/index.js"
|
|
12
|
+
},
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "https://github.com/appwrite/sdk-for-cli"
|
|
16
|
+
},
|
|
17
|
+
"scripts": {
|
|
18
|
+
"build": "tsc",
|
|
19
|
+
"format": "prettier --write \"**/*.{js,ts,json,md}\"",
|
|
20
|
+
"generate": "tsx scripts/generate-commands.ts",
|
|
21
|
+
"prepublishOnly": "npm run build",
|
|
22
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
23
|
+
"linux-x64": "bun run build && bun build ./dist/index.js --compile --sourcemap=inline --target=bun-linux-x64 --outfile build/appwrite-cli-linux-x64",
|
|
24
|
+
"linux-arm64": "bun run build && bun build ./dist/index.js --compile --sourcemap=inline --target=bun-linux-arm64 --outfile build/appwrite-cli-linux-arm64",
|
|
25
|
+
"mac-x64": "bun run build && bun build ./dist/index.js --compile --sourcemap=inline --target=bun-darwin-x64 --outfile build/appwrite-cli-darwin-x64",
|
|
26
|
+
"mac-arm64": "bun run build && bun build ./dist/index.js --compile --sourcemap=inline --target=bun-darwin-arm64 --outfile build/appwrite-cli-darwin-arm64",
|
|
27
|
+
"windows-x64": "bun run build && bun build ./dist/index.js --compile --sourcemap=inline --target=bun-windows-x64 --outfile build/appwrite-cli-win-x64.exe",
|
|
28
|
+
"windows-arm64": "bun run build && esbuild dist/index.js --bundle --platform=node --format=cjs --outfile=dist/bundle.cjs --external:@appwrite.io/console --external:fsevents && pkg dist/bundle.cjs -t node18-win-arm64 -o build/appwrite-cli-win-arm64.exe"
|
|
29
|
+
},
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"@appwrite.io/console": "^2.1.0",
|
|
32
|
+
"chalk": "4.1.2",
|
|
33
|
+
"chokidar": "^3.6.0",
|
|
34
|
+
"cli-progress": "^3.12.0",
|
|
35
|
+
"cli-table3": "^0.6.2",
|
|
36
|
+
"commander": "^9.2.0",
|
|
37
|
+
"dotenv": "^16.4.5",
|
|
38
|
+
"ejs": "^3.1.9",
|
|
39
|
+
"form-data": "^4.0.0",
|
|
40
|
+
"ignore": "^7.0.5",
|
|
41
|
+
"inquirer": "^8.2.4",
|
|
42
|
+
"inquirer-search-list": "^1.2.6",
|
|
43
|
+
"json-bigint": "^1.0.0",
|
|
44
|
+
"tail": "^2.2.6",
|
|
45
|
+
"tar": "^6.1.11",
|
|
46
|
+
"undici": "^5.28.2"
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"@types/bun": "^1.3.5",
|
|
50
|
+
"@types/cli-progress": "^3.11.5",
|
|
51
|
+
"@types/inquirer": "^8.2.10",
|
|
52
|
+
"@types/json-bigint": "^1.0.4",
|
|
53
|
+
"@types/node": "^18.19.0",
|
|
54
|
+
"@types/tar": "^6.1.11",
|
|
55
|
+
"@yao-pkg/pkg": "^6.11.0",
|
|
56
|
+
"esbuild": "^0.27.2",
|
|
57
|
+
"prettier": "^3.7.4",
|
|
58
|
+
"tsx": "^4.21.0",
|
|
59
|
+
"typescript": "^5.3.3"
|
|
60
|
+
},
|
|
61
|
+
"pkg": {
|
|
62
|
+
"scripts": [
|
|
63
|
+
"dist/index.js",
|
|
64
|
+
"dist/lib/**/*.js"
|
|
65
|
+
]
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-commands.d.ts","sourceRoot":"","sources":["../../scripts/generate-commands.ts"],"names":[],"mappings":""}
|