appwrite-cli 0.14.0
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/npm-publish.yml +41 -0
- package/Formula/appwrite.rb +19 -0
- package/LICENSE.md +12 -0
- package/README.md +102 -0
- package/docs/examples/account/create-anonymous-session.md +1 -0
- package/docs/examples/account/create-j-w-t.md +1 -0
- package/docs/examples/account/create-magic-u-r-l-session.md +4 -0
- package/docs/examples/account/create-o-auth2session.md +5 -0
- package/docs/examples/account/create-recovery.md +3 -0
- package/docs/examples/account/create-session.md +3 -0
- package/docs/examples/account/create-verification.md +2 -0
- package/docs/examples/account/create.md +5 -0
- package/docs/examples/account/delete-session.md +2 -0
- package/docs/examples/account/delete-sessions.md +1 -0
- package/docs/examples/account/delete.md +1 -0
- package/docs/examples/account/get-logs.md +3 -0
- package/docs/examples/account/get-prefs.md +1 -0
- package/docs/examples/account/get-session.md +2 -0
- package/docs/examples/account/get-sessions.md +1 -0
- package/docs/examples/account/get.md +1 -0
- package/docs/examples/account/update-email.md +3 -0
- package/docs/examples/account/update-magic-u-r-l-session.md +3 -0
- package/docs/examples/account/update-name.md +2 -0
- package/docs/examples/account/update-password.md +3 -0
- package/docs/examples/account/update-prefs.md +2 -0
- package/docs/examples/account/update-recovery.md +5 -0
- package/docs/examples/account/update-session.md +2 -0
- package/docs/examples/account/update-verification.md +3 -0
- package/docs/examples/avatars/get-browser.md +5 -0
- package/docs/examples/avatars/get-credit-card.md +5 -0
- package/docs/examples/avatars/get-favicon.md +2 -0
- package/docs/examples/avatars/get-flag.md +5 -0
- package/docs/examples/avatars/get-image.md +4 -0
- package/docs/examples/avatars/get-initials.md +6 -0
- package/docs/examples/avatars/get-q-r.md +5 -0
- package/docs/examples/database/create-boolean-attribute.md +6 -0
- package/docs/examples/database/create-collection.md +6 -0
- package/docs/examples/database/create-document.md +6 -0
- package/docs/examples/database/create-email-attribute.md +6 -0
- package/docs/examples/database/create-enum-attribute.md +7 -0
- package/docs/examples/database/create-float-attribute.md +8 -0
- package/docs/examples/database/create-index.md +6 -0
- package/docs/examples/database/create-integer-attribute.md +8 -0
- package/docs/examples/database/create-ip-attribute.md +6 -0
- package/docs/examples/database/create-string-attribute.md +7 -0
- package/docs/examples/database/create-url-attribute.md +6 -0
- package/docs/examples/database/delete-attribute.md +3 -0
- package/docs/examples/database/delete-collection.md +2 -0
- package/docs/examples/database/delete-document.md +3 -0
- package/docs/examples/database/delete-index.md +3 -0
- package/docs/examples/database/get-attribute.md +3 -0
- package/docs/examples/database/get-collection-usage.md +3 -0
- package/docs/examples/database/get-collection.md +2 -0
- package/docs/examples/database/get-document.md +3 -0
- package/docs/examples/database/get-index.md +3 -0
- package/docs/examples/database/get-usage.md +2 -0
- package/docs/examples/database/list-attributes.md +2 -0
- package/docs/examples/database/list-collection-logs.md +4 -0
- package/docs/examples/database/list-collections.md +7 -0
- package/docs/examples/database/list-document-logs.md +5 -0
- package/docs/examples/database/list-documents.md +9 -0
- package/docs/examples/database/list-indexes.md +2 -0
- package/docs/examples/database/update-collection.md +7 -0
- package/docs/examples/database/update-document.md +6 -0
- package/docs/examples/functions/create-deployment.md +5 -0
- package/docs/examples/functions/create-execution.md +4 -0
- package/docs/examples/functions/create.md +9 -0
- package/docs/examples/functions/delete-deployment.md +3 -0
- package/docs/examples/functions/delete.md +2 -0
- package/docs/examples/functions/get-deployment.md +3 -0
- package/docs/examples/functions/get-execution.md +3 -0
- package/docs/examples/functions/get-usage.md +3 -0
- package/docs/examples/functions/get.md +2 -0
- package/docs/examples/functions/list-deployments.md +8 -0
- package/docs/examples/functions/list-executions.md +7 -0
- package/docs/examples/functions/list-runtimes.md +1 -0
- package/docs/examples/functions/list.md +7 -0
- package/docs/examples/functions/retry-build.md +4 -0
- package/docs/examples/functions/update-deployment.md +3 -0
- package/docs/examples/functions/update.md +8 -0
- package/docs/examples/health/get-antivirus.md +1 -0
- package/docs/examples/health/get-cache.md +1 -0
- package/docs/examples/health/get-d-b.md +1 -0
- package/docs/examples/health/get-queue-certificates.md +1 -0
- package/docs/examples/health/get-queue-functions.md +1 -0
- package/docs/examples/health/get-queue-logs.md +1 -0
- package/docs/examples/health/get-queue-usage.md +1 -0
- package/docs/examples/health/get-queue-webhooks.md +1 -0
- package/docs/examples/health/get-storage-local.md +1 -0
- package/docs/examples/health/get-time.md +1 -0
- package/docs/examples/health/get.md +1 -0
- package/docs/examples/locale/get-continents.md +1 -0
- package/docs/examples/locale/get-countries-e-u.md +1 -0
- package/docs/examples/locale/get-countries-phones.md +1 -0
- package/docs/examples/locale/get-countries.md +1 -0
- package/docs/examples/locale/get-currencies.md +1 -0
- package/docs/examples/locale/get-languages.md +1 -0
- package/docs/examples/locale/get.md +1 -0
- package/docs/examples/projects/create-domain.md +3 -0
- package/docs/examples/projects/create-key.md +4 -0
- package/docs/examples/projects/create-platform.md +7 -0
- package/docs/examples/projects/create-webhook.md +8 -0
- package/docs/examples/projects/create.md +13 -0
- package/docs/examples/projects/delete-domain.md +3 -0
- package/docs/examples/projects/delete-key.md +3 -0
- package/docs/examples/projects/delete-platform.md +3 -0
- package/docs/examples/projects/delete-webhook.md +3 -0
- package/docs/examples/projects/delete.md +3 -0
- package/docs/examples/projects/get-domain.md +3 -0
- package/docs/examples/projects/get-key.md +3 -0
- package/docs/examples/projects/get-platform.md +3 -0
- package/docs/examples/projects/get-usage.md +3 -0
- package/docs/examples/projects/get-webhook.md +3 -0
- package/docs/examples/projects/get.md +2 -0
- package/docs/examples/projects/list-domains.md +2 -0
- package/docs/examples/projects/list-keys.md +2 -0
- package/docs/examples/projects/list-platforms.md +2 -0
- package/docs/examples/projects/list-webhooks.md +2 -0
- package/docs/examples/projects/list.md +7 -0
- package/docs/examples/projects/update-auth-limit.md +3 -0
- package/docs/examples/projects/update-auth-status.md +4 -0
- package/docs/examples/projects/update-domain-verification.md +3 -0
- package/docs/examples/projects/update-key.md +5 -0
- package/docs/examples/projects/update-o-auth2.md +5 -0
- package/docs/examples/projects/update-platform.md +7 -0
- package/docs/examples/projects/update-service-status.md +4 -0
- package/docs/examples/projects/update-webhook.md +9 -0
- package/docs/examples/projects/update.md +12 -0
- package/docs/examples/storage/create-bucket.md +11 -0
- package/docs/examples/storage/create-file.md +6 -0
- package/docs/examples/storage/delete-bucket.md +2 -0
- package/docs/examples/storage/delete-file.md +3 -0
- package/docs/examples/storage/get-bucket-usage.md +3 -0
- package/docs/examples/storage/get-bucket.md +2 -0
- package/docs/examples/storage/get-file-download.md +3 -0
- package/docs/examples/storage/get-file-preview.md +14 -0
- package/docs/examples/storage/get-file-view.md +3 -0
- package/docs/examples/storage/get-file.md +3 -0
- package/docs/examples/storage/get-usage.md +2 -0
- package/docs/examples/storage/list-buckets.md +7 -0
- package/docs/examples/storage/list-files.md +8 -0
- package/docs/examples/storage/update-bucket.md +11 -0
- package/docs/examples/storage/update-file.md +5 -0
- package/docs/examples/teams/create-membership.md +6 -0
- package/docs/examples/teams/create.md +4 -0
- package/docs/examples/teams/delete-membership.md +3 -0
- package/docs/examples/teams/delete.md +2 -0
- package/docs/examples/teams/get-membership.md +3 -0
- package/docs/examples/teams/get-memberships.md +8 -0
- package/docs/examples/teams/get.md +2 -0
- package/docs/examples/teams/list.md +7 -0
- package/docs/examples/teams/update-membership-roles.md +4 -0
- package/docs/examples/teams/update-membership-status.md +5 -0
- package/docs/examples/teams/update.md +3 -0
- package/docs/examples/users/create.md +5 -0
- package/docs/examples/users/delete-session.md +3 -0
- package/docs/examples/users/delete-sessions.md +2 -0
- package/docs/examples/users/delete.md +2 -0
- package/docs/examples/users/get-logs.md +4 -0
- package/docs/examples/users/get-prefs.md +2 -0
- package/docs/examples/users/get-sessions.md +2 -0
- package/docs/examples/users/get-usage.md +3 -0
- package/docs/examples/users/get.md +2 -0
- package/docs/examples/users/list.md +7 -0
- package/docs/examples/users/update-email.md +3 -0
- package/docs/examples/users/update-name.md +3 -0
- package/docs/examples/users/update-password.md +3 -0
- package/docs/examples/users/update-prefs.md +3 -0
- package/docs/examples/users/update-status.md +3 -0
- package/docs/examples/users/update-verification.md +3 -0
- package/index.js +49 -0
- package/install.sh +165 -0
- package/ldid/COPYING +661 -0
- package/ldid/Makefile +51 -0
- package/ldid/control +12 -0
- package/ldid/control.sh +5 -0
- package/ldid/deb.sh +10 -0
- package/ldid/ios.sh +2 -0
- package/ldid/ldid.cpp +3253 -0
- package/ldid/ldid.hpp +164 -0
- package/ldid/libplist/.github/workflows/build.yml +62 -0
- package/ldid/libplist/.github/workflows/codeql-analysis.yml +71 -0
- package/ldid/libplist/AUTHORS +28 -0
- package/ldid/libplist/COPYING +340 -0
- package/ldid/libplist/COPYING.LESSER +502 -0
- package/ldid/libplist/Makefile.am +20 -0
- package/ldid/libplist/NEWS +252 -0
- package/ldid/libplist/README.md +114 -0
- package/ldid/libplist/aclocal.m4 +1729 -0
- package/ldid/libplist/autogen.sh +26 -0
- package/ldid/libplist/configure.ac +292 -0
- package/ldid/libplist/cython/Makefile.am +53 -0
- package/ldid/libplist/cython/plist.pxd +78 -0
- package/ldid/libplist/cython/plist.pyx +947 -0
- package/ldid/libplist/cython/plist_util.c +40 -0
- package/ldid/libplist/cython/plist_util.h +5 -0
- package/ldid/libplist/docs/Makefile.am +3 -0
- package/ldid/libplist/docs/plistutil.1 +62 -0
- package/ldid/libplist/fuzz/Makefile.am +43 -0
- package/ldid/libplist/fuzz/bplist-crashes/clusterfuzz-testcase-4766291097288704 +0 -0
- package/ldid/libplist/fuzz/bplist-crashes/clusterfuzz-testcase-4930725262393344 +0 -0
- package/ldid/libplist/fuzz/bplist-crashes/clusterfuzz-testcase-5421965105954816 +0 -0
- package/ldid/libplist/fuzz/bplist-crashes/clusterfuzz-testcase-5556177727389696 +0 -0
- package/ldid/libplist/fuzz/bplist-crashes/clusterfuzz-testcase-6557963011489792 +0 -0
- package/ldid/libplist/fuzz/bplist-crashes/clusterfuzz-testcase-6605859144597504 +0 -0
- package/ldid/libplist/fuzz/bplist-crashes/crash-0ce4dd483b645bc05ec45a97d285dcf1933ee840 +0 -0
- package/ldid/libplist/fuzz/bplist-crashes/crash-0d59cdcb5c3416c2790612b78a631ce9f5622800 +0 -0
- package/ldid/libplist/fuzz/bplist-crashes/crash-17d635ab460fef74df1ac7561f1253533a6359c5 +0 -0
- package/ldid/libplist/fuzz/bplist-crashes/crash-33a67313fa7864cd627ef92d12017a127d342f28 +0 -0
- package/ldid/libplist/fuzz/bplist-crashes/crash-39f1347115f8fe9ac25cdc9332e3fc5cd32c7f7b +0 -0
- package/ldid/libplist/fuzz/bplist-crashes/crash-4bd78175fe01d07c5ee90104fbc68d95dd092210 +0 -0
- package/ldid/libplist/fuzz/bplist-crashes/crash-4c5404453bb7425aef9b953a5f6f3f0afcc48392 +0 -0
- package/ldid/libplist/fuzz/bplist-crashes/crash-52775e25f6af20af351cd616834e602fc988a032 +0 -0
- package/ldid/libplist/fuzz/bplist-crashes/crash-6d1399685b745d3d49fadc91072fabcdde8d16fa +0 -0
- package/ldid/libplist/fuzz/bplist-crashes/crash-94b3725900d63c6258448fd757559c81002de9c9 +0 -0
- package/ldid/libplist/fuzz/bplist-crashes/crash-a47195acbabc3f5b2cda9c6ebda42f2afc1cc5af +0 -0
- package/ldid/libplist/fuzz/bplist-crashes/crash-ce852bae6aeeffc4698a93660236f1b995ce966e +0 -0
- package/ldid/libplist/fuzz/bplist-crashes/crash-daddb6e82e3d1ed76e20e4131462f5247a6fb131 +0 -0
- package/ldid/libplist/fuzz/bplist-crashes/crash-f21be4ebce7f9c337bf96b93cec7e252f5c75a21 +0 -0
- package/ldid/libplist/fuzz/bplist-crashes/crash-f779dafccc0164684d1a264976e56037188b40e2 +0 -0
- package/ldid/libplist/fuzz/bplist-leaks/leak-96fb453b3ba18d31e164831795a708183b5a0dac +0 -0
- package/ldid/libplist/fuzz/bplist-leaks/leak-acb3c00a83d7635638a476a4e70fc1f1caa1a5b1 +0 -0
- package/ldid/libplist/fuzz/bplist-leaks/leak-fe2cd4b1f67e0c9b21e6225a4fb4ca19eab80074 +0 -0
- package/ldid/libplist/fuzz/bplist.dict +1 -0
- package/ldid/libplist/fuzz/bplist_fuzzer.cc +32 -0
- package/ldid/libplist/fuzz/bplist_fuzzer.options +3 -0
- package/ldid/libplist/fuzz/fuzzers.test +8 -0
- package/ldid/libplist/fuzz/init-fuzzers.sh +23 -0
- package/ldid/libplist/fuzz/test-fuzzers.sh +33 -0
- package/ldid/libplist/fuzz/xplist-crashes/clusterfuzz-testcase-4516959125241856 +0 -0
- package/ldid/libplist/fuzz/xplist-crashes/clusterfuzz-testcase-4663876528373760 +5 -0
- package/ldid/libplist/fuzz/xplist-crashes/clusterfuzz-testcase-5799076113154048 +45 -0
- package/ldid/libplist/fuzz/xplist-crashes/clusterfuzz-testcase-5922404220010496 +0 -0
- package/ldid/libplist/fuzz/xplist-crashes/clusterfuzz-testcase-6015098361479168 +0 -0
- package/ldid/libplist/fuzz/xplist-crashes/clusterfuzz-testcase-6043836860071936 +0 -0
- package/ldid/libplist/fuzz/xplist-crashes/clusterfuzz-testcase-6047509906456576 +10050 -0
- package/ldid/libplist/fuzz/xplist-crashes/clusterfuzz-testcase-6482601374121984 +0 -0
- package/ldid/libplist/fuzz/xplist-crashes/crash-09788d7acb46b4b177422f9c4ee54556a3ad1f17 +53 -0
- package/ldid/libplist/fuzz/xplist-crashes/crash-155c60d5c4b2778110fb4a633caa7d64eb9b99c1 +9 -0
- package/ldid/libplist/fuzz/xplist-crashes/crash-348c909a0b3532977185f551eb5d2ed04e694883 +11 -0
- package/ldid/libplist/fuzz/xplist-crashes/crash-7bc172e27a2b1d4fcaf031f59d1f08fb83081e4a +8 -0
- package/ldid/libplist/fuzz/xplist-crashes/crash-80c28b0e2a446665e68927dd4441c10c9a68e64e +0 -0
- package/ldid/libplist/fuzz/xplist-crashes/crash-8acf177da60ecf13c36d0da1b8e25de891980ea6 +5 -0
- package/ldid/libplist/fuzz/xplist-crashes/crash-94276cf69a50e78dd6cdf079c208cb80f357cd33 +0 -0
- package/ldid/libplist/fuzz/xplist-crashes/crash-9ddb891a0ec42401eb4629e6b99e01aef7909eb9 +0 -0
- package/ldid/libplist/fuzz/xplist-crashes/crash-a8b44e1f5be4f75f00a937016ec5405bce77a0f9 +0 -0
- package/ldid/libplist/fuzz/xplist-crashes/crash-da39a3ee5e6b4b0d3255bfef95601890afd80709 +0 -0
- package/ldid/libplist/fuzz/xplist-crashes/crash-f03c680ee1c4d84c28e731752df77a61e213a24d +72 -0
- package/ldid/libplist/fuzz/xplist-leaks/clusterfuzz-testcase-4634751103139840 +187 -0
- package/ldid/libplist/fuzz/xplist-leaks/clusterfuzz-testcase-6056412121661440 +12 -0
- package/ldid/libplist/fuzz/xplist-leaks/leak-47b0a9f21d3affab6cfc898e5140bb53265ada07 +0 -0
- package/ldid/libplist/fuzz/xplist-leaks/leak-4c81aae70b20d9b9408b78d40999a54205bdcfb7 +0 -0
- package/ldid/libplist/fuzz/xplist-leaks/leak-53bc466851eda790bd891733da5db0a7482886bf +6 -0
- package/ldid/libplist/fuzz/xplist.dict +51 -0
- package/ldid/libplist/fuzz/xplist_fuzzer.cc +32 -0
- package/ldid/libplist/fuzz/xplist_fuzzer.options +3 -0
- package/ldid/libplist/include/Makefile.am +15 -0
- package/ldid/libplist/include/plist/Array.h +55 -0
- package/ldid/libplist/include/plist/Boolean.h +48 -0
- package/ldid/libplist/include/plist/Data.h +49 -0
- package/ldid/libplist/include/plist/Date.h +50 -0
- package/ldid/libplist/include/plist/Dictionary.h +68 -0
- package/ldid/libplist/include/plist/Integer.h +48 -0
- package/ldid/libplist/include/plist/Key.h +49 -0
- package/ldid/libplist/include/plist/Node.h +57 -0
- package/ldid/libplist/include/plist/Real.h +48 -0
- package/ldid/libplist/include/plist/String.h +49 -0
- package/ldid/libplist/include/plist/Structure.h +59 -0
- package/ldid/libplist/include/plist/Uid.h +48 -0
- package/ldid/libplist/include/plist/plist++.h +39 -0
- package/ldid/libplist/include/plist/plist.h +953 -0
- package/ldid/libplist/libcnary/COPYING +502 -0
- package/ldid/libplist/libcnary/Makefile.am +15 -0
- package/ldid/libplist/libcnary/README +5 -0
- package/ldid/libplist/libcnary/cnary.c +46 -0
- package/ldid/libplist/libcnary/include/node.h +65 -0
- package/ldid/libplist/libcnary/include/node_list.h +47 -0
- package/ldid/libplist/libcnary/include/object.h +41 -0
- package/ldid/libplist/libcnary/node.c +216 -0
- package/ldid/libplist/libcnary/node_list.c +157 -0
- package/ldid/libplist/m4/ac_pkg_cython.m4 +67 -0
- package/ldid/libplist/m4/as-compiler-flag.m4 +62 -0
- package/ldid/libplist/m4/ax_pthread.m4 +485 -0
- package/ldid/libplist/m4/ax_python_devel.m4 +327 -0
- package/ldid/libplist/m4/cython_python.m4 +7 -0
- package/ldid/libplist/src/Array.cpp +148 -0
- package/ldid/libplist/src/Boolean.cpp +73 -0
- package/ldid/libplist/src/Data.cpp +79 -0
- package/ldid/libplist/src/Date.cpp +76 -0
- package/ldid/libplist/src/Dictionary.cpp +182 -0
- package/ldid/libplist/src/Integer.cpp +73 -0
- package/ldid/libplist/src/Key.cpp +80 -0
- package/ldid/libplist/src/Makefile.am +63 -0
- package/ldid/libplist/src/Node.cpp +166 -0
- package/ldid/libplist/src/Real.cpp +73 -0
- package/ldid/libplist/src/String.cpp +80 -0
- package/ldid/libplist/src/Structure.cpp +123 -0
- package/ldid/libplist/src/Uid.cpp +73 -0
- package/ldid/libplist/src/base64.c +119 -0
- package/ldid/libplist/src/base64.h +28 -0
- package/ldid/libplist/src/bplist.c +1381 -0
- package/ldid/libplist/src/bytearray.c +61 -0
- package/ldid/libplist/src/bytearray.h +36 -0
- package/ldid/libplist/src/hashtable.c +140 -0
- package/ldid/libplist/src/hashtable.h +50 -0
- package/ldid/libplist/src/plist.c +1356 -0
- package/ldid/libplist/src/plist.h +74 -0
- package/ldid/libplist/src/ptrarray.c +96 -0
- package/ldid/libplist/src/ptrarray.h +40 -0
- package/ldid/libplist/src/strbuf.h +34 -0
- package/ldid/libplist/src/time64.c +814 -0
- package/ldid/libplist/src/time64.h +81 -0
- package/ldid/libplist/src/time64_limits.h +97 -0
- package/ldid/libplist/src/xplist.c +1435 -0
- package/ldid/libplist/test/Makefile.am +93 -0
- package/ldid/libplist/test/amp.test +14 -0
- package/ldid/libplist/test/bigarray.test +15 -0
- package/ldid/libplist/test/cdata.test +12 -0
- package/ldid/libplist/test/data/1.plist +35 -0
- package/ldid/libplist/test/data/2.plist +100 -0
- package/ldid/libplist/test/data/3.plist +420 -0
- package/ldid/libplist/test/data/4.plist +5037 -0
- package/ldid/libplist/test/data/5.plist +55053 -0
- package/ldid/libplist/test/data/6.plist +4006 -0
- package/ldid/libplist/test/data/7.plist +14 -0
- package/ldid/libplist/test/data/amp.plist +6 -0
- package/ldid/libplist/test/data/cdata.plist +6 -0
- package/ldid/libplist/test/data/dictref1byte.bplist +0 -0
- package/ldid/libplist/test/data/dictref2bytes.bplist +0 -0
- package/ldid/libplist/test/data/dictref3bytes.bplist +0 -0
- package/ldid/libplist/test/data/dictref4bytes.bplist +0 -0
- package/ldid/libplist/test/data/dictref5bytes.bplist +0 -0
- package/ldid/libplist/test/data/dictref6bytes.bplist +0 -0
- package/ldid/libplist/test/data/dictref7bytes.bplist +0 -0
- package/ldid/libplist/test/data/dictref8bytes.bplist +0 -0
- package/ldid/libplist/test/data/empty_keys.plist +8 -0
- package/ldid/libplist/test/data/entities.plist +57 -0
- package/ldid/libplist/test/data/hex.plist +5 -0
- package/ldid/libplist/test/data/invalid_tag.plist +6 -0
- package/ldid/libplist/test/data/malformed_dict.bplist +0 -0
- package/ldid/libplist/test/data/off1byte.bplist +0 -0
- package/ldid/libplist/test/data/off2bytes.bplist +0 -0
- package/ldid/libplist/test/data/off3bytes.bplist +0 -0
- package/ldid/libplist/test/data/off4bytes.bplist +0 -0
- package/ldid/libplist/test/data/off5bytes.bplist +0 -0
- package/ldid/libplist/test/data/off6bytes.bplist +0 -0
- package/ldid/libplist/test/data/off7bytes.bplist +0 -0
- package/ldid/libplist/test/data/off8bytes.bplist +0 -0
- package/ldid/libplist/test/data/offxml.plist +8 -0
- package/ldid/libplist/test/data/order.bplist +0 -0
- package/ldid/libplist/test/data/order.plist +27 -0
- package/ldid/libplist/test/data/recursion.bplist +0 -0
- package/ldid/libplist/test/data/signed.bplist +0 -0
- package/ldid/libplist/test/data/signed.plist +5 -0
- package/ldid/libplist/test/data/signedunsigned.bplist +0 -0
- package/ldid/libplist/test/data/signedunsigned.plist +11 -0
- package/ldid/libplist/test/data/unsigned.bplist +0 -0
- package/ldid/libplist/test/data/unsigned.plist +5 -0
- package/ldid/libplist/test/dates.test +15 -0
- package/ldid/libplist/test/empty.test +15 -0
- package/ldid/libplist/test/empty_keys.test +12 -0
- package/ldid/libplist/test/entities.test +12 -0
- package/ldid/libplist/test/hex.test +12 -0
- package/ldid/libplist/test/huge.test +15 -0
- package/ldid/libplist/test/invalid_tag.test +14 -0
- package/ldid/libplist/test/large.test +15 -0
- package/ldid/libplist/test/malformed_dict.test +11 -0
- package/ldid/libplist/test/medium.test +15 -0
- package/ldid/libplist/test/offsetsize.test +12 -0
- package/ldid/libplist/test/order.test +13 -0
- package/ldid/libplist/test/plist_cmp.c +158 -0
- package/ldid/libplist/test/plist_test.c +135 -0
- package/ldid/libplist/test/recursion.test +11 -0
- package/ldid/libplist/test/refsize.test +12 -0
- package/ldid/libplist/test/signedunsigned1.test +23 -0
- package/ldid/libplist/test/signedunsigned2.test +23 -0
- package/ldid/libplist/test/signedunsigned3.test +23 -0
- package/ldid/libplist/test/small.test +15 -0
- package/ldid/libplist/test/timezone1.test +17 -0
- package/ldid/libplist/test/timezone2.test +21 -0
- package/ldid/libplist/tools/Makefile.am +10 -0
- package/ldid/libplist/tools/plistutil.c +299 -0
- package/ldid/lookup2.c +416 -0
- package/ldid/make.sh +90 -0
- package/ldid/minimal/hexdump.h +76 -0
- package/ldid/minimal/mapping.h +72 -0
- package/ldid/minimal/sqlite3.h +71 -0
- package/ldid/minimal/stdlib.h +129 -0
- package/ldid/minimal/string.h +51 -0
- package/ldid/plist.sh +2 -0
- package/ldid/sha1.h +64 -0
- package/ldid/sysroot.sh +31 -0
- package/ldid/version.sh +2 -0
- package/lib/client.js +243 -0
- package/lib/commands/account.js +785 -0
- package/lib/commands/avatars.js +349 -0
- package/lib/commands/database.js +1238 -0
- package/lib/commands/deploy.js +477 -0
- package/lib/commands/functions.js +689 -0
- package/lib/commands/generic.js +106 -0
- package/lib/commands/health.js +269 -0
- package/lib/commands/init.js +148 -0
- package/lib/commands/locale.js +177 -0
- package/lib/commands/projects.js +1191 -0
- package/lib/commands/storage.js +743 -0
- package/lib/commands/teams.js +435 -0
- package/lib/commands/users.js +542 -0
- package/lib/config.js +264 -0
- package/lib/exception.js +9 -0
- package/lib/parser.js +179 -0
- package/lib/questions.js +223 -0
- package/lib/sdks.js +82 -0
- package/package.json +41 -0
|
@@ -0,0 +1,785 @@
|
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
const { promisify } = require('util');
|
|
3
|
+
const libClient = require('../client.js');
|
|
4
|
+
const childProcess = require('child_process');
|
|
5
|
+
const { Command } = require('commander');
|
|
6
|
+
const { sdkForProject, sdkForConsole } = require('../sdks')
|
|
7
|
+
const { parse, actionRunner, parseInteger, parseBool, commandDescriptions, success, log } = require('../parser')
|
|
8
|
+
const { localConfig, globalConfig } = require("../config");
|
|
9
|
+
|
|
10
|
+
const account = new Command("account").description(commandDescriptions['account'])
|
|
11
|
+
|
|
12
|
+
const accountGet = async ({ parseOutput = true, sdk = undefined}) => {
|
|
13
|
+
|
|
14
|
+
let client = !sdk ? await sdkForProject() : sdk;
|
|
15
|
+
let path = '/account';
|
|
16
|
+
let payload = {};
|
|
17
|
+
let response = undefined;
|
|
18
|
+
response = await client.call('get', path, {
|
|
19
|
+
'content-type': 'application/json',
|
|
20
|
+
}, payload);
|
|
21
|
+
|
|
22
|
+
if (parseOutput) {
|
|
23
|
+
parse(response)
|
|
24
|
+
success()
|
|
25
|
+
}
|
|
26
|
+
return response;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const accountCreate = async ({ userId, email, password, name, parseOutput = true, sdk = undefined}) => {
|
|
30
|
+
/* @param {string} userId */
|
|
31
|
+
/* @param {string} email */
|
|
32
|
+
/* @param {string} password */
|
|
33
|
+
/* @param {string} name */
|
|
34
|
+
|
|
35
|
+
let client = !sdk ? await sdkForProject() : sdk;
|
|
36
|
+
let path = '/account';
|
|
37
|
+
let payload = {};
|
|
38
|
+
|
|
39
|
+
/** Body Params */
|
|
40
|
+
if (typeof userId !== 'undefined') {
|
|
41
|
+
payload['userId'] = userId;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if (typeof email !== 'undefined') {
|
|
45
|
+
payload['email'] = email;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
if (typeof password !== 'undefined') {
|
|
49
|
+
payload['password'] = password;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if (typeof name !== 'undefined') {
|
|
53
|
+
payload['name'] = name;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
let response = undefined;
|
|
57
|
+
response = await client.call('post', path, {
|
|
58
|
+
'content-type': 'application/json',
|
|
59
|
+
}, payload);
|
|
60
|
+
|
|
61
|
+
if (parseOutput) {
|
|
62
|
+
parse(response)
|
|
63
|
+
success()
|
|
64
|
+
}
|
|
65
|
+
return response;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const accountDelete = async ({ parseOutput = true, sdk = undefined}) => {
|
|
69
|
+
|
|
70
|
+
let client = !sdk ? await sdkForProject() : sdk;
|
|
71
|
+
let path = '/account';
|
|
72
|
+
let payload = {};
|
|
73
|
+
let response = undefined;
|
|
74
|
+
response = await client.call('delete', path, {
|
|
75
|
+
'content-type': 'application/json',
|
|
76
|
+
}, payload);
|
|
77
|
+
|
|
78
|
+
if (parseOutput) {
|
|
79
|
+
parse(response)
|
|
80
|
+
success()
|
|
81
|
+
}
|
|
82
|
+
return response;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const accountUpdateEmail = async ({ email, password, parseOutput = true, sdk = undefined}) => {
|
|
86
|
+
/* @param {string} email */
|
|
87
|
+
/* @param {string} password */
|
|
88
|
+
|
|
89
|
+
let client = !sdk ? await sdkForProject() : sdk;
|
|
90
|
+
let path = '/account/email';
|
|
91
|
+
let payload = {};
|
|
92
|
+
|
|
93
|
+
/** Body Params */
|
|
94
|
+
if (typeof email !== 'undefined') {
|
|
95
|
+
payload['email'] = email;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
if (typeof password !== 'undefined') {
|
|
99
|
+
payload['password'] = password;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
let response = undefined;
|
|
103
|
+
response = await client.call('patch', path, {
|
|
104
|
+
'content-type': 'application/json',
|
|
105
|
+
}, payload);
|
|
106
|
+
|
|
107
|
+
if (parseOutput) {
|
|
108
|
+
parse(response)
|
|
109
|
+
success()
|
|
110
|
+
}
|
|
111
|
+
return response;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
const accountCreateJWT = async ({ parseOutput = true, sdk = undefined}) => {
|
|
115
|
+
|
|
116
|
+
let client = !sdk ? await sdkForProject() : sdk;
|
|
117
|
+
let path = '/account/jwt';
|
|
118
|
+
let payload = {};
|
|
119
|
+
let response = undefined;
|
|
120
|
+
response = await client.call('post', path, {
|
|
121
|
+
'content-type': 'application/json',
|
|
122
|
+
}, payload);
|
|
123
|
+
|
|
124
|
+
if (parseOutput) {
|
|
125
|
+
parse(response)
|
|
126
|
+
success()
|
|
127
|
+
}
|
|
128
|
+
return response;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
const accountGetLogs = async ({ limit, offset, parseOutput = true, sdk = undefined}) => {
|
|
132
|
+
/* @param {number} limit */
|
|
133
|
+
/* @param {number} offset */
|
|
134
|
+
|
|
135
|
+
let client = !sdk ? await sdkForProject() : sdk;
|
|
136
|
+
let path = '/account/logs';
|
|
137
|
+
let payload = {};
|
|
138
|
+
|
|
139
|
+
/** Query Params */
|
|
140
|
+
if (typeof limit !== 'undefined') {
|
|
141
|
+
payload['limit'] = limit;
|
|
142
|
+
}
|
|
143
|
+
if (typeof offset !== 'undefined') {
|
|
144
|
+
payload['offset'] = offset;
|
|
145
|
+
}
|
|
146
|
+
let response = undefined;
|
|
147
|
+
response = await client.call('get', path, {
|
|
148
|
+
'content-type': 'application/json',
|
|
149
|
+
}, payload);
|
|
150
|
+
|
|
151
|
+
if (parseOutput) {
|
|
152
|
+
parse(response)
|
|
153
|
+
success()
|
|
154
|
+
}
|
|
155
|
+
return response;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
const accountUpdateName = async ({ name, parseOutput = true, sdk = undefined}) => {
|
|
159
|
+
/* @param {string} name */
|
|
160
|
+
|
|
161
|
+
let client = !sdk ? await sdkForProject() : sdk;
|
|
162
|
+
let path = '/account/name';
|
|
163
|
+
let payload = {};
|
|
164
|
+
|
|
165
|
+
/** Body Params */
|
|
166
|
+
if (typeof name !== 'undefined') {
|
|
167
|
+
payload['name'] = name;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
let response = undefined;
|
|
171
|
+
response = await client.call('patch', path, {
|
|
172
|
+
'content-type': 'application/json',
|
|
173
|
+
}, payload);
|
|
174
|
+
|
|
175
|
+
if (parseOutput) {
|
|
176
|
+
parse(response)
|
|
177
|
+
success()
|
|
178
|
+
}
|
|
179
|
+
return response;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
const accountUpdatePassword = async ({ password, oldPassword, parseOutput = true, sdk = undefined}) => {
|
|
183
|
+
/* @param {string} password */
|
|
184
|
+
/* @param {string} oldPassword */
|
|
185
|
+
|
|
186
|
+
let client = !sdk ? await sdkForProject() : sdk;
|
|
187
|
+
let path = '/account/password';
|
|
188
|
+
let payload = {};
|
|
189
|
+
|
|
190
|
+
/** Body Params */
|
|
191
|
+
if (typeof password !== 'undefined') {
|
|
192
|
+
payload['password'] = password;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
if (typeof oldPassword !== 'undefined') {
|
|
196
|
+
payload['oldPassword'] = oldPassword;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
let response = undefined;
|
|
200
|
+
response = await client.call('patch', path, {
|
|
201
|
+
'content-type': 'application/json',
|
|
202
|
+
}, payload);
|
|
203
|
+
|
|
204
|
+
if (parseOutput) {
|
|
205
|
+
parse(response)
|
|
206
|
+
success()
|
|
207
|
+
}
|
|
208
|
+
return response;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
const accountGetPrefs = async ({ parseOutput = true, sdk = undefined}) => {
|
|
212
|
+
|
|
213
|
+
let client = !sdk ? await sdkForProject() : sdk;
|
|
214
|
+
let path = '/account/prefs';
|
|
215
|
+
let payload = {};
|
|
216
|
+
let response = undefined;
|
|
217
|
+
response = await client.call('get', path, {
|
|
218
|
+
'content-type': 'application/json',
|
|
219
|
+
}, payload);
|
|
220
|
+
|
|
221
|
+
if (parseOutput) {
|
|
222
|
+
parse(response)
|
|
223
|
+
success()
|
|
224
|
+
}
|
|
225
|
+
return response;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
const accountUpdatePrefs = async ({ prefs, parseOutput = true, sdk = undefined}) => {
|
|
229
|
+
/* @param {object} prefs */
|
|
230
|
+
|
|
231
|
+
let client = !sdk ? await sdkForProject() : sdk;
|
|
232
|
+
let path = '/account/prefs';
|
|
233
|
+
let payload = {};
|
|
234
|
+
|
|
235
|
+
/** Body Params */
|
|
236
|
+
if (typeof prefs !== 'undefined') {
|
|
237
|
+
payload['prefs'] = prefs;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
let response = undefined;
|
|
241
|
+
response = await client.call('patch', path, {
|
|
242
|
+
'content-type': 'application/json',
|
|
243
|
+
}, payload);
|
|
244
|
+
|
|
245
|
+
if (parseOutput) {
|
|
246
|
+
parse(response)
|
|
247
|
+
success()
|
|
248
|
+
}
|
|
249
|
+
return response;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
const accountCreateRecovery = async ({ email, url, parseOutput = true, sdk = undefined}) => {
|
|
253
|
+
/* @param {string} email */
|
|
254
|
+
/* @param {string} url */
|
|
255
|
+
|
|
256
|
+
let client = !sdk ? await sdkForProject() : sdk;
|
|
257
|
+
let path = '/account/recovery';
|
|
258
|
+
let payload = {};
|
|
259
|
+
|
|
260
|
+
/** Body Params */
|
|
261
|
+
if (typeof email !== 'undefined') {
|
|
262
|
+
payload['email'] = email;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
if (typeof url !== 'undefined') {
|
|
266
|
+
payload['url'] = url;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
let response = undefined;
|
|
270
|
+
response = await client.call('post', path, {
|
|
271
|
+
'content-type': 'application/json',
|
|
272
|
+
}, payload);
|
|
273
|
+
|
|
274
|
+
if (parseOutput) {
|
|
275
|
+
parse(response)
|
|
276
|
+
success()
|
|
277
|
+
}
|
|
278
|
+
return response;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
const accountUpdateRecovery = async ({ userId, secret, password, passwordAgain, parseOutput = true, sdk = undefined}) => {
|
|
282
|
+
/* @param {string} userId */
|
|
283
|
+
/* @param {string} secret */
|
|
284
|
+
/* @param {string} password */
|
|
285
|
+
/* @param {string} passwordAgain */
|
|
286
|
+
|
|
287
|
+
let client = !sdk ? await sdkForProject() : sdk;
|
|
288
|
+
let path = '/account/recovery';
|
|
289
|
+
let payload = {};
|
|
290
|
+
|
|
291
|
+
/** Body Params */
|
|
292
|
+
if (typeof userId !== 'undefined') {
|
|
293
|
+
payload['userId'] = userId;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
if (typeof secret !== 'undefined') {
|
|
297
|
+
payload['secret'] = secret;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
if (typeof password !== 'undefined') {
|
|
301
|
+
payload['password'] = password;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
if (typeof passwordAgain !== 'undefined') {
|
|
305
|
+
payload['passwordAgain'] = passwordAgain;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
let response = undefined;
|
|
309
|
+
response = await client.call('put', path, {
|
|
310
|
+
'content-type': 'application/json',
|
|
311
|
+
}, payload);
|
|
312
|
+
|
|
313
|
+
if (parseOutput) {
|
|
314
|
+
parse(response)
|
|
315
|
+
success()
|
|
316
|
+
}
|
|
317
|
+
return response;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
const accountGetSessions = async ({ parseOutput = true, sdk = undefined}) => {
|
|
321
|
+
|
|
322
|
+
let client = !sdk ? await sdkForProject() : sdk;
|
|
323
|
+
let path = '/account/sessions';
|
|
324
|
+
let payload = {};
|
|
325
|
+
let response = undefined;
|
|
326
|
+
response = await client.call('get', path, {
|
|
327
|
+
'content-type': 'application/json',
|
|
328
|
+
}, payload);
|
|
329
|
+
|
|
330
|
+
if (parseOutput) {
|
|
331
|
+
parse(response)
|
|
332
|
+
success()
|
|
333
|
+
}
|
|
334
|
+
return response;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
const accountCreateSession = async ({ email, password, parseOutput = true, sdk = undefined}) => {
|
|
338
|
+
/* @param {string} email */
|
|
339
|
+
/* @param {string} password */
|
|
340
|
+
|
|
341
|
+
let client = !sdk ? await sdkForProject() : sdk;
|
|
342
|
+
let path = '/account/sessions';
|
|
343
|
+
let payload = {};
|
|
344
|
+
|
|
345
|
+
/** Body Params */
|
|
346
|
+
if (typeof email !== 'undefined') {
|
|
347
|
+
payload['email'] = email;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
if (typeof password !== 'undefined') {
|
|
351
|
+
payload['password'] = password;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
let response = undefined;
|
|
355
|
+
response = await client.call('post', path, {
|
|
356
|
+
'content-type': 'application/json',
|
|
357
|
+
}, payload);
|
|
358
|
+
|
|
359
|
+
if (parseOutput) {
|
|
360
|
+
parse(response)
|
|
361
|
+
success()
|
|
362
|
+
}
|
|
363
|
+
return response;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
const accountDeleteSessions = async ({ parseOutput = true, sdk = undefined}) => {
|
|
367
|
+
|
|
368
|
+
let client = !sdk ? await sdkForProject() : sdk;
|
|
369
|
+
let path = '/account/sessions';
|
|
370
|
+
let payload = {};
|
|
371
|
+
let response = undefined;
|
|
372
|
+
response = await client.call('delete', path, {
|
|
373
|
+
'content-type': 'application/json',
|
|
374
|
+
}, payload);
|
|
375
|
+
|
|
376
|
+
if (parseOutput) {
|
|
377
|
+
parse(response)
|
|
378
|
+
success()
|
|
379
|
+
}
|
|
380
|
+
return response;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
const accountCreateAnonymousSession = async ({ parseOutput = true, sdk = undefined}) => {
|
|
384
|
+
|
|
385
|
+
let client = !sdk ? await sdkForProject() : sdk;
|
|
386
|
+
let path = '/account/sessions/anonymous';
|
|
387
|
+
let payload = {};
|
|
388
|
+
let response = undefined;
|
|
389
|
+
response = await client.call('post', path, {
|
|
390
|
+
'content-type': 'application/json',
|
|
391
|
+
}, payload);
|
|
392
|
+
|
|
393
|
+
if (parseOutput) {
|
|
394
|
+
parse(response)
|
|
395
|
+
success()
|
|
396
|
+
}
|
|
397
|
+
return response;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
const accountCreateMagicURLSession = async ({ userId, email, url, parseOutput = true, sdk = undefined}) => {
|
|
401
|
+
/* @param {string} userId */
|
|
402
|
+
/* @param {string} email */
|
|
403
|
+
/* @param {string} url */
|
|
404
|
+
|
|
405
|
+
let client = !sdk ? await sdkForProject() : sdk;
|
|
406
|
+
let path = '/account/sessions/magic-url';
|
|
407
|
+
let payload = {};
|
|
408
|
+
|
|
409
|
+
/** Body Params */
|
|
410
|
+
if (typeof userId !== 'undefined') {
|
|
411
|
+
payload['userId'] = userId;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
if (typeof email !== 'undefined') {
|
|
415
|
+
payload['email'] = email;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
if (typeof url !== 'undefined') {
|
|
419
|
+
payload['url'] = url;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
let response = undefined;
|
|
423
|
+
response = await client.call('post', path, {
|
|
424
|
+
'content-type': 'application/json',
|
|
425
|
+
}, payload);
|
|
426
|
+
|
|
427
|
+
if (parseOutput) {
|
|
428
|
+
parse(response)
|
|
429
|
+
success()
|
|
430
|
+
}
|
|
431
|
+
return response;
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
const accountUpdateMagicURLSession = async ({ userId, secret, parseOutput = true, sdk = undefined}) => {
|
|
435
|
+
/* @param {string} userId */
|
|
436
|
+
/* @param {string} secret */
|
|
437
|
+
|
|
438
|
+
let client = !sdk ? await sdkForProject() : sdk;
|
|
439
|
+
let path = '/account/sessions/magic-url';
|
|
440
|
+
let payload = {};
|
|
441
|
+
|
|
442
|
+
/** Body Params */
|
|
443
|
+
if (typeof userId !== 'undefined') {
|
|
444
|
+
payload['userId'] = userId;
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
if (typeof secret !== 'undefined') {
|
|
448
|
+
payload['secret'] = secret;
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
let response = undefined;
|
|
452
|
+
response = await client.call('put', path, {
|
|
453
|
+
'content-type': 'application/json',
|
|
454
|
+
}, payload);
|
|
455
|
+
|
|
456
|
+
if (parseOutput) {
|
|
457
|
+
parse(response)
|
|
458
|
+
success()
|
|
459
|
+
}
|
|
460
|
+
return response;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
const accountCreateOAuth2Session = async ({ provider, success, failure, scopes, parseOutput = true, sdk = undefined}) => {
|
|
464
|
+
/* @param {string} provider */
|
|
465
|
+
/* @param {string} success */
|
|
466
|
+
/* @param {string} failure */
|
|
467
|
+
/* @param {string[]} scopes */
|
|
468
|
+
|
|
469
|
+
let client = !sdk ? await sdkForProject() : sdk;
|
|
470
|
+
let path = '/account/sessions/oauth2/{provider}'.replace('{provider}', provider);
|
|
471
|
+
let payload = {};
|
|
472
|
+
|
|
473
|
+
/** Query Params */
|
|
474
|
+
if (typeof success !== 'undefined') {
|
|
475
|
+
payload['success'] = success;
|
|
476
|
+
}
|
|
477
|
+
if (typeof failure !== 'undefined') {
|
|
478
|
+
payload['failure'] = failure;
|
|
479
|
+
}
|
|
480
|
+
if (typeof scopes !== 'undefined') {
|
|
481
|
+
payload['scopes'] = scopes;
|
|
482
|
+
}
|
|
483
|
+
let response = undefined;
|
|
484
|
+
response = await client.call('get', path, {
|
|
485
|
+
'content-type': 'application/json',
|
|
486
|
+
}, payload);
|
|
487
|
+
|
|
488
|
+
if (parseOutput) {
|
|
489
|
+
parse(response)
|
|
490
|
+
success()
|
|
491
|
+
}
|
|
492
|
+
return response;
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
const accountGetSession = async ({ sessionId, parseOutput = true, sdk = undefined}) => {
|
|
496
|
+
/* @param {string} sessionId */
|
|
497
|
+
|
|
498
|
+
let client = !sdk ? await sdkForProject() : sdk;
|
|
499
|
+
let path = '/account/sessions/{sessionId}'.replace('{sessionId}', sessionId);
|
|
500
|
+
let payload = {};
|
|
501
|
+
let response = undefined;
|
|
502
|
+
response = await client.call('get', path, {
|
|
503
|
+
'content-type': 'application/json',
|
|
504
|
+
}, payload);
|
|
505
|
+
|
|
506
|
+
if (parseOutput) {
|
|
507
|
+
parse(response)
|
|
508
|
+
success()
|
|
509
|
+
}
|
|
510
|
+
return response;
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
const accountUpdateSession = async ({ sessionId, parseOutput = true, sdk = undefined}) => {
|
|
514
|
+
/* @param {string} sessionId */
|
|
515
|
+
|
|
516
|
+
let client = !sdk ? await sdkForProject() : sdk;
|
|
517
|
+
let path = '/account/sessions/{sessionId}'.replace('{sessionId}', sessionId);
|
|
518
|
+
let payload = {};
|
|
519
|
+
let response = undefined;
|
|
520
|
+
response = await client.call('patch', path, {
|
|
521
|
+
'content-type': 'application/json',
|
|
522
|
+
}, payload);
|
|
523
|
+
|
|
524
|
+
if (parseOutput) {
|
|
525
|
+
parse(response)
|
|
526
|
+
success()
|
|
527
|
+
}
|
|
528
|
+
return response;
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
const accountDeleteSession = async ({ sessionId, parseOutput = true, sdk = undefined}) => {
|
|
532
|
+
/* @param {string} sessionId */
|
|
533
|
+
|
|
534
|
+
let client = !sdk ? await sdkForProject() : sdk;
|
|
535
|
+
let path = '/account/sessions/{sessionId}'.replace('{sessionId}', sessionId);
|
|
536
|
+
let payload = {};
|
|
537
|
+
let response = undefined;
|
|
538
|
+
response = await client.call('delete', path, {
|
|
539
|
+
'content-type': 'application/json',
|
|
540
|
+
}, payload);
|
|
541
|
+
|
|
542
|
+
if (parseOutput) {
|
|
543
|
+
parse(response)
|
|
544
|
+
success()
|
|
545
|
+
}
|
|
546
|
+
return response;
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
const accountCreateVerification = async ({ url, parseOutput = true, sdk = undefined}) => {
|
|
550
|
+
/* @param {string} url */
|
|
551
|
+
|
|
552
|
+
let client = !sdk ? await sdkForProject() : sdk;
|
|
553
|
+
let path = '/account/verification';
|
|
554
|
+
let payload = {};
|
|
555
|
+
|
|
556
|
+
/** Body Params */
|
|
557
|
+
if (typeof url !== 'undefined') {
|
|
558
|
+
payload['url'] = url;
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
let response = undefined;
|
|
562
|
+
response = await client.call('post', path, {
|
|
563
|
+
'content-type': 'application/json',
|
|
564
|
+
}, payload);
|
|
565
|
+
|
|
566
|
+
if (parseOutput) {
|
|
567
|
+
parse(response)
|
|
568
|
+
success()
|
|
569
|
+
}
|
|
570
|
+
return response;
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
const accountUpdateVerification = async ({ userId, secret, parseOutput = true, sdk = undefined}) => {
|
|
574
|
+
/* @param {string} userId */
|
|
575
|
+
/* @param {string} secret */
|
|
576
|
+
|
|
577
|
+
let client = !sdk ? await sdkForProject() : sdk;
|
|
578
|
+
let path = '/account/verification';
|
|
579
|
+
let payload = {};
|
|
580
|
+
|
|
581
|
+
/** Body Params */
|
|
582
|
+
if (typeof userId !== 'undefined') {
|
|
583
|
+
payload['userId'] = userId;
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
if (typeof secret !== 'undefined') {
|
|
587
|
+
payload['secret'] = secret;
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
let response = undefined;
|
|
591
|
+
response = await client.call('put', path, {
|
|
592
|
+
'content-type': 'application/json',
|
|
593
|
+
}, payload);
|
|
594
|
+
|
|
595
|
+
if (parseOutput) {
|
|
596
|
+
parse(response)
|
|
597
|
+
success()
|
|
598
|
+
}
|
|
599
|
+
return response;
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
|
|
603
|
+
account
|
|
604
|
+
.command(`get`)
|
|
605
|
+
.description(`Get currently logged in user data as JSON object.`)
|
|
606
|
+
.action(actionRunner(accountGet))
|
|
607
|
+
|
|
608
|
+
account
|
|
609
|
+
.command(`create`)
|
|
610
|
+
.description(`Use this endpoint to allow a new user to register a new account in your project. After the user registration completes successfully, you can use the [/account/verfication](/docs/client/account#accountCreateVerification) route to start verifying the user email address. To allow the new user to login to their new account, you need to create a new [account session](/docs/client/account#accountCreateSession).`)
|
|
611
|
+
.requiredOption(`--userId <userId>`, `Unique Id. Choose your own unique ID or pass the string "unique()" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`)
|
|
612
|
+
.requiredOption(`--email <email>`, `User email.`)
|
|
613
|
+
.requiredOption(`--password <password>`, `User password. Must be at least 8 chars.`)
|
|
614
|
+
.option(`--name <name>`, `User name. Max length: 128 chars.`)
|
|
615
|
+
.action(actionRunner(accountCreate))
|
|
616
|
+
|
|
617
|
+
account
|
|
618
|
+
.command(`delete`)
|
|
619
|
+
.description(`Delete a currently logged in user account. Behind the scene, the user record is not deleted but permanently blocked from any access. This is done to avoid deleted accounts being overtaken by new users with the same email address. Any user-related resources like documents or storage files should be deleted separately.`)
|
|
620
|
+
.action(actionRunner(accountDelete))
|
|
621
|
+
|
|
622
|
+
account
|
|
623
|
+
.command(`updateEmail`)
|
|
624
|
+
.description(`Update currently logged in user account email address. After changing user address, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request. This endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password. `)
|
|
625
|
+
.requiredOption(`--email <email>`, `User email.`)
|
|
626
|
+
.requiredOption(`--password <password>`, `User password. Must be at least 8 chars.`)
|
|
627
|
+
.action(actionRunner(accountUpdateEmail))
|
|
628
|
+
|
|
629
|
+
account
|
|
630
|
+
.command(`createJWT`)
|
|
631
|
+
.description(`Use this endpoint to create a JSON Web Token. You can use the resulting JWT to authenticate on behalf of the current user when working with the Appwrite server-side API and SDKs. The JWT secret is valid for 15 minutes from its creation and will be invalid if the user will logout in that time frame.`)
|
|
632
|
+
.action(actionRunner(accountCreateJWT))
|
|
633
|
+
|
|
634
|
+
account
|
|
635
|
+
.command(`getLogs`)
|
|
636
|
+
.description(`Get currently logged in user list of latest security activity logs. Each log returns user IP address, location and date and time of log.`)
|
|
637
|
+
.option(`--limit <limit>`, `Maximum number of logs to return in response. By default will return maximum 25 results. Maximum of 100 results allowed per request.`, parseInteger)
|
|
638
|
+
.option(`--offset <offset>`, `Offset value. The default value is 0. Use this value to manage pagination. [learn more about pagination](https://appwrite.io/docs/pagination)`, parseInteger)
|
|
639
|
+
.action(actionRunner(accountGetLogs))
|
|
640
|
+
|
|
641
|
+
account
|
|
642
|
+
.command(`updateName`)
|
|
643
|
+
.description(`Update currently logged in user account name.`)
|
|
644
|
+
.requiredOption(`--name <name>`, `User name. Max length: 128 chars.`)
|
|
645
|
+
.action(actionRunner(accountUpdateName))
|
|
646
|
+
|
|
647
|
+
account
|
|
648
|
+
.command(`updatePassword`)
|
|
649
|
+
.description(`Update currently logged in user password. For validation, user is required to pass in the new password, and the old password. For users created with OAuth and Team Invites, oldPassword is optional.`)
|
|
650
|
+
.requiredOption(`--password <password>`, `New user password. Must be at least 8 chars.`)
|
|
651
|
+
.option(`--oldPassword <oldPassword>`, `Current user password. Must be at least 8 chars.`)
|
|
652
|
+
.action(actionRunner(accountUpdatePassword))
|
|
653
|
+
|
|
654
|
+
account
|
|
655
|
+
.command(`getPrefs`)
|
|
656
|
+
.description(`Get currently logged in user preferences as a key-value object.`)
|
|
657
|
+
.action(actionRunner(accountGetPrefs))
|
|
658
|
+
|
|
659
|
+
account
|
|
660
|
+
.command(`updatePrefs`)
|
|
661
|
+
.description(`Update currently logged in user account preferences. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.`)
|
|
662
|
+
.requiredOption(`--prefs <prefs>`, `Prefs key-value JSON object.`)
|
|
663
|
+
.action(actionRunner(accountUpdatePrefs))
|
|
664
|
+
|
|
665
|
+
account
|
|
666
|
+
.command(`createRecovery`)
|
|
667
|
+
.description(`Sends the user an email with a temporary secret key for password reset. When the user clicks the confirmation link he is redirected back to your app password reset URL with the secret key and email address values attached to the URL query string. Use the query string params to submit a request to the [PUT /account/recovery](/docs/client/account#accountUpdateRecovery) endpoint to complete the process. The verification link sent to the user's email address is valid for 1 hour.`)
|
|
668
|
+
.requiredOption(`--email <email>`, `User email.`)
|
|
669
|
+
.requiredOption(`--url <url>`, `URL to redirect the user back to your app from the recovery email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.`)
|
|
670
|
+
.action(actionRunner(accountCreateRecovery))
|
|
671
|
+
|
|
672
|
+
account
|
|
673
|
+
.command(`updateRecovery`)
|
|
674
|
+
.description(`Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST /account/recovery](/docs/client/account#accountCreateRecovery) endpoint. Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.`)
|
|
675
|
+
.requiredOption(`--userId <userId>`, `User ID.`)
|
|
676
|
+
.requiredOption(`--secret <secret>`, `Valid reset token.`)
|
|
677
|
+
.requiredOption(`--password <password>`, `New user password. Must be at least 8 chars.`)
|
|
678
|
+
.requiredOption(`--passwordAgain <passwordAgain>`, `Repeat new user password. Must be at least 8 chars.`)
|
|
679
|
+
.action(actionRunner(accountUpdateRecovery))
|
|
680
|
+
|
|
681
|
+
account
|
|
682
|
+
.command(`getSessions`)
|
|
683
|
+
.description(`Get currently logged in user list of active sessions across different devices.`)
|
|
684
|
+
.action(actionRunner(accountGetSessions))
|
|
685
|
+
|
|
686
|
+
account
|
|
687
|
+
.command(`createSession`)
|
|
688
|
+
.description(`Allow the user to login into their account by providing a valid email and password combination. This route will create a new session for the user.`)
|
|
689
|
+
.requiredOption(`--email <email>`, `User email.`)
|
|
690
|
+
.requiredOption(`--password <password>`, `User password. Must be at least 8 chars.`)
|
|
691
|
+
.action(actionRunner(accountCreateSession))
|
|
692
|
+
|
|
693
|
+
account
|
|
694
|
+
.command(`deleteSessions`)
|
|
695
|
+
.description(`Delete all sessions from the user account and remove any sessions cookies from the end client.`)
|
|
696
|
+
.action(actionRunner(accountDeleteSessions))
|
|
697
|
+
|
|
698
|
+
account
|
|
699
|
+
.command(`createAnonymousSession`)
|
|
700
|
+
.description(`Use this endpoint to allow a new user to register an anonymous account in your project. This route will also create a new session for the user. To allow the new user to convert an anonymous account to a normal account, you need to update its [email and password](/docs/client/account#accountUpdateEmail) or create an [OAuth2 session](/docs/client/account#accountCreateOAuth2Session).`)
|
|
701
|
+
.action(actionRunner(accountCreateAnonymousSession))
|
|
702
|
+
|
|
703
|
+
account
|
|
704
|
+
.command(`createMagicURLSession`)
|
|
705
|
+
.description(`Sends the user an email with a secret key for creating a session. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [PUT /account/sessions/magic-url](/docs/client/account#accountUpdateMagicURLSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour. If you are on a mobile device you can leave the URL parameter empty, so that the login completion will be handled by your Appwrite instance by default.`)
|
|
706
|
+
.requiredOption(`--userId <userId>`, `Unique Id. Choose your own unique ID or pass the string "unique()" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.`)
|
|
707
|
+
.requiredOption(`--email <email>`, `User email.`)
|
|
708
|
+
.option(`--url <url>`, `URL to redirect the user back to your app from the magic URL login. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.`)
|
|
709
|
+
.action(actionRunner(accountCreateMagicURLSession))
|
|
710
|
+
|
|
711
|
+
account
|
|
712
|
+
.command(`updateMagicURLSession`)
|
|
713
|
+
.description(`Use this endpoint to complete creating the session with the Magic URL. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST /account/sessions/magic-url](/docs/client/account#accountCreateMagicURLSession) endpoint. Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.`)
|
|
714
|
+
.requiredOption(`--userId <userId>`, `User ID.`)
|
|
715
|
+
.requiredOption(`--secret <secret>`, `Valid verification token.`)
|
|
716
|
+
.action(actionRunner(accountUpdateMagicURLSession))
|
|
717
|
+
|
|
718
|
+
account
|
|
719
|
+
.command(`createOAuth2Session`)
|
|
720
|
+
.description(`Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appwrite console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed. If there is already an active session, the new session will be attached to the logged-in account. If there are no active sessions, the server will attempt to look for a user with the same email address as the email received from the OAuth2 provider and attach the new session to the existing user. If no matching user is found - the server will create a new user.. `)
|
|
721
|
+
.requiredOption(`--provider <provider>`, `OAuth2 Provider. Currently, supported providers are: amazon, apple, bitbucket, bitly, box, discord, dropbox, facebook, github, gitlab, google, linkedin, microsoft, notion, paypal, paypalSandbox, salesforce, slack, spotify, tradeshift, tradeshiftBox, twitch, vk, yahoo, yammer, yandex, wordpress, stripe.`)
|
|
722
|
+
.option(`--success <success>`, `URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.`)
|
|
723
|
+
.option(`--failure <failure>`, `URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.`)
|
|
724
|
+
.option(`--scopes <scopes...>`, `A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes.`)
|
|
725
|
+
.action(actionRunner(accountCreateOAuth2Session))
|
|
726
|
+
|
|
727
|
+
account
|
|
728
|
+
.command(`getSession`)
|
|
729
|
+
.description(`Use this endpoint to get a logged in user's session using a Session ID. Inputting 'current' will return the current session being used.`)
|
|
730
|
+
.requiredOption(`--sessionId <sessionId>`, `Session ID. Use the string 'current' to get the current device session.`)
|
|
731
|
+
.action(actionRunner(accountGetSession))
|
|
732
|
+
|
|
733
|
+
account
|
|
734
|
+
.command(`updateSession`)
|
|
735
|
+
.description(``)
|
|
736
|
+
.requiredOption(`--sessionId <sessionId>`, `Session ID. Use the string 'current' to update the current device session.`)
|
|
737
|
+
.action(actionRunner(accountUpdateSession))
|
|
738
|
+
|
|
739
|
+
account
|
|
740
|
+
.command(`deleteSession`)
|
|
741
|
+
.description(`Use this endpoint to log out the currently logged in user from all their account sessions across all of their different devices. When using the Session ID argument, only the unique session ID provided is deleted. `)
|
|
742
|
+
.requiredOption(`--sessionId <sessionId>`, `Session ID. Use the string 'current' to delete the current device session.`)
|
|
743
|
+
.action(actionRunner(accountDeleteSession))
|
|
744
|
+
|
|
745
|
+
account
|
|
746
|
+
.command(`createVerification`)
|
|
747
|
+
.description(`Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](/docs/client/account#accountUpdateVerification). The verification link sent to the user's email address is valid for 7 days. Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface. `)
|
|
748
|
+
.requiredOption(`--url <url>`, `URL to redirect the user back to your app from the verification email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.`)
|
|
749
|
+
.action(actionRunner(accountCreateVerification))
|
|
750
|
+
|
|
751
|
+
account
|
|
752
|
+
.command(`updateVerification`)
|
|
753
|
+
.description(`Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code.`)
|
|
754
|
+
.requiredOption(`--userId <userId>`, `User ID.`)
|
|
755
|
+
.requiredOption(`--secret <secret>`, `Valid verification token.`)
|
|
756
|
+
.action(actionRunner(accountUpdateVerification))
|
|
757
|
+
|
|
758
|
+
|
|
759
|
+
module.exports = {
|
|
760
|
+
account,
|
|
761
|
+
accountGet,
|
|
762
|
+
accountCreate,
|
|
763
|
+
accountDelete,
|
|
764
|
+
accountUpdateEmail,
|
|
765
|
+
accountCreateJWT,
|
|
766
|
+
accountGetLogs,
|
|
767
|
+
accountUpdateName,
|
|
768
|
+
accountUpdatePassword,
|
|
769
|
+
accountGetPrefs,
|
|
770
|
+
accountUpdatePrefs,
|
|
771
|
+
accountCreateRecovery,
|
|
772
|
+
accountUpdateRecovery,
|
|
773
|
+
accountGetSessions,
|
|
774
|
+
accountCreateSession,
|
|
775
|
+
accountDeleteSessions,
|
|
776
|
+
accountCreateAnonymousSession,
|
|
777
|
+
accountCreateMagicURLSession,
|
|
778
|
+
accountUpdateMagicURLSession,
|
|
779
|
+
accountCreateOAuth2Session,
|
|
780
|
+
accountGetSession,
|
|
781
|
+
accountUpdateSession,
|
|
782
|
+
accountDeleteSession,
|
|
783
|
+
accountCreateVerification,
|
|
784
|
+
accountUpdateVerification
|
|
785
|
+
};
|