├── .all-contributorsrc ├── .gitattributes ├── .github ├── FUNDING.yml ├── ISSUE_TEMPLATE │ ├── documentation.yaml │ ├── feature.yaml │ └── snippet_bug.yaml ├── PULL_REQUEST_TEMPLATE.md ├── images │ ├── awesome-appwrite-logo.png │ ├── awesome-badge.png │ ├── awesone-appwrite-snippets-banner.png │ └── contributing.jpg └── workflows │ └── build.yml ├── .gitignore ├── .vscode └── launch.json ├── .vscodeignore ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── logo.png ├── package-lock.json ├── package.json ├── snippets ├── android_java │ └── client.code-snippets ├── apple │ └── client.code-snippets ├── dart │ ├── account.code-snippets │ └── client.code-snippets ├── flutter │ ├── account.code-snippets │ ├── client.code-snippets │ ├── database.code-snippets │ ├── storage.code-snippets │ └── teams.code-snippets ├── javascript │ └── client.code-snippets ├── kotlin │ ├── account.code-snippets │ ├── client.code-snippets │ ├── health.code-snippets │ └── teams.code-snippets ├── php │ └── health.code-snippets └── web │ ├── account.code-snippets │ ├── client.code-snippets │ ├── database.code-snippets │ ├── functions-code.snippets.code-snippets │ ├── storage.code-snippets │ └── teams.code-snippets └── vsc-extension-quickstart.md /.all-contributorsrc: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | "README.md" 4 | ], 5 | "imageSize": 100, 6 | "commit": false, 7 | "commitConvention": "angular", 8 | "contributors": [ 9 | { 10 | "login": "Nikhil-1503", 11 | "name": "Nikhil Shanbhag", 12 | "avatar_url": "https://avatars.githubusercontent.com/u/61755381?v=4", 13 | "profile": "https://github.com/Nikhil-1503", 14 | "contributions": [ 15 | "maintenance" 16 | ] 17 | }, 18 | { 19 | "login": "Pranjalmishra30", 20 | "name": "Pranjal Mishra", 21 | "avatar_url": "https://avatars.githubusercontent.com/u/55613727?v=4", 22 | "profile": "https://www.linkedin.com/in/pranjal-mishra-3a79b0196/", 23 | "contributions": [ 24 | "maintenance" 25 | ] 26 | }, 27 | { 28 | "login": "Rajat379", 29 | "name": "Rajat379", 30 | "avatar_url": "https://avatars.githubusercontent.com/u/51928008?v=4", 31 | "profile": "https://github.com/Rajat379", 32 | "contributions": [ 33 | "code" 34 | ] 35 | }, 36 | { 37 | "login": "Meldiron", 38 | "name": "Matej Bačo", 39 | "avatar_url": "https://avatars.githubusercontent.com/u/19310830?v=4", 40 | "profile": "http://matejbaco.eu", 41 | "contributions": [ 42 | "code", 43 | "doc" 44 | ] 45 | }, 46 | { 47 | "login": "RJ025", 48 | "name": "RITIK JAIN", 49 | "avatar_url": "https://avatars.githubusercontent.com/u/93763090?v=4", 50 | "profile": "https://github.com/RJ025", 51 | "contributions": [ 52 | "code", 53 | "doc" 54 | ] 55 | }, 56 | { 57 | "login": "adityaoberai", 58 | "name": "Aditya Oberai", 59 | "avatar_url": "https://avatars.githubusercontent.com/u/31401437?v=4", 60 | "profile": "https://oberai.dev", 61 | "contributions": [ 62 | "code", 63 | "bug" 64 | ] 65 | }, 66 | { 67 | "login": "GunjanGupta26", 68 | "name": "Gunjan Gupta", 69 | "avatar_url": "https://avatars.githubusercontent.com/u/89540928?v=4", 70 | "profile": "https://github.com/GunjanGupta26", 71 | "contributions": [ 72 | "code" 73 | ] 74 | } 75 | ], 76 | "contributorsPerLine": 7, 77 | "skipCi": true, 78 | "repoType": "github", 79 | "repoHost": "https://github.com", 80 | "projectName": "awesome-appwrite-snippets", 81 | "projectOwner": "2002Bishwajeet" 82 | } 83 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Set default behavior to automatically normalize line endings. 2 | * text=auto 3 | 4 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: 2002bishwajeet # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry 13 | custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] 14 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/documentation.yaml: -------------------------------------------------------------------------------- 1 | name: "📚 Documentation" 2 | description: "Report an issue related to documentation" 3 | title: "📚 Documentation: " 4 | labels: [documentation] 5 | body: 6 | - type: markdown 7 | attributes: 8 | value: | 9 | Thanks for taking the time to make our documentation better 🙏 10 | - type: textarea 11 | id: issue-description 12 | validations: 13 | required: true 14 | attributes: 15 | label: "💭 Description" 16 | description: "A clear and concise description of what the issue is." 17 | placeholder: "Documentation should not ..." 18 | - type: checkboxes 19 | id: no-duplicate-issues 20 | attributes: 21 | label: "👀 Have you spent some time to check if this issue has been raised before?" 22 | description: "Have you Googled for a similar issue or checked our older issues for a similar bug?" 23 | options: 24 | - label: "I checked and didn't find similar issue" 25 | required: true 26 | - type: checkboxes 27 | id: read-code-of-conduct 28 | attributes: 29 | label: "🏢 Have you read the Code of Conduct?" 30 | options: 31 | - label: "I have read the [Code of Conduct](https://github.com/2002Bishwajeet/awesome-appwrite-snippets/blob/master/CODE_OF_CONDUCT.md)" 32 | required: true 33 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature.yaml: -------------------------------------------------------------------------------- 1 | name: 🚀 Feature 2 | description: "Submit a proposal for a new feature" 3 | title: "🚀 Feature: " 4 | labels: [feature] 5 | body: 6 | - type: markdown 7 | attributes: 8 | value: | 9 | Thanks for taking the time to fill out our feature request form 🙏 10 | - type: textarea 11 | id: feature-description 12 | validations: 13 | required: true 14 | attributes: 15 | label: "🔖 Feature description" 16 | description: "A clear and concise description of what the feature is." 17 | placeholder: "You should add ..." 18 | - type: textarea 19 | id: pitch 20 | validations: 21 | required: true 22 | attributes: 23 | label: "🎤 Pitch" 24 | description: "Please explain why this feature should be implemented and how it would be used. Add examples, if applicable." 25 | placeholder: "In my use-case, ..." 26 | - type: checkboxes 27 | id: no-duplicate-issues 28 | attributes: 29 | label: "👀 Have you spent some time to check if this issue has been raised before?" 30 | description: "Have you Googled for a similar issue or checked our older issues for a similar bug?" 31 | options: 32 | - label: "I checked and didn't find similar issue" 33 | required: true 34 | - type: checkboxes 35 | id: read-code-of-conduct 36 | attributes: 37 | label: "🏢 Have you read the Code of Conduct?" 38 | options: 39 | - label: "I have read the [Code of Conduct](https://github.com/2002Bishwajeet/awesome-appwrite-snippets/blob/master/CODE_OF_CONDUCT.md)" 40 | required: true 41 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/snippet_bug.yaml: -------------------------------------------------------------------------------- 1 | name: "🐛 Bug Report" 2 | description: "Submit a bug report to help us improve" 3 | title: "🐛 Bug Report: " 4 | labels: [bug] 5 | body: 6 | - type: markdown 7 | attributes: 8 | value: | 9 | Thanks for taking the time to fill out our bug report form 🙏 10 | - type: textarea 11 | id: steps-to-reproduce 12 | validations: 13 | required: true 14 | attributes: 15 | label: "👟 Reproduction steps" 16 | description: "How do you trigger this bug? Please walk us through it step by step." 17 | placeholder: "When I ..." 18 | - type: textarea 19 | id: expected-behavior 20 | validations: 21 | required: true 22 | attributes: 23 | label: "👍 Expected behavior" 24 | description: "What did you think would happen?" 25 | placeholder: "It should ..." 26 | - type: textarea 27 | id: actual-behavior 28 | validations: 29 | required: true 30 | attributes: 31 | label: "👎 Actual Behavior" 32 | description: "What did actually happen? Add screenshots, if applicable." 33 | placeholder: "It actually ..." 34 | - type: dropdown 35 | id: appwrite-version 36 | attributes: 37 | label: "🎲 Appwrite version" 38 | description: "What version of Appwrite are you running?" 39 | options: 40 | - Version 1.0.x 41 | - Version 0.15.x 42 | - Version 0.14.x 43 | - Version 0.13.x 44 | validations: 45 | required: true 46 | - type: dropdown 47 | id: awesome-appwrite-snippet-version 48 | attributes: 49 | label: "🎲 Awesome Appwrite Snippet version" 50 | description: "What version of Awesome Appwrite Snippet are you running?" 51 | options: 52 | - Version 0.2.x 53 | - Version 0.1.x 54 | validations: 55 | required: true 56 | - type: dropdown 57 | id: operating-system 58 | attributes: 59 | label: "💻 Operating system" 60 | description: "What OS is your server / device running on?" 61 | options: 62 | - Linux 63 | - MacOS 64 | - Windows 65 | - Something else 66 | validations: 67 | required: true 68 | - type: checkboxes 69 | id: no-duplicate-issues 70 | attributes: 71 | label: "👀 Have you spent some time to check if this issue has been raised before?" 72 | description: "Have you Googled for a similar issue or checked our older issues for a similar bug?" 73 | options: 74 | - label: "I checked and didn't find similar issue" 75 | required: true 76 | - type: checkboxes 77 | id: read-code-of-conduct 78 | attributes: 79 | label: "🏢 Have you read the Code of Conduct?" 80 | options: 81 | - label: "I have read the [Code of Conduct](https://github.com/2002Bishwajeet/awesome-appwrite-snippets/blob/master/CODE_OF_CONDUCT.md)" 82 | required: true 83 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## Description 2 | (A brief summary of the contribution and the problem it solves. Try to keep the description short and only include relevant details) 3 | 4 | ## Testing 5 | (Describe steps to test out and verify the changes.You can also include images or screenshots of the result for better understanding) 6 | 7 | ## Checklist 8 | - [ ] Followed the [contribution guidelines](https://github.com/2002Bishwajeet/awesome-appwrite-snippets/blob/master/CONTRIBUTING.md) 9 | - [ ] The code is commented properly to give appropriate context. 10 | -------------------------------------------------------------------------------- /.github/images/awesome-appwrite-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2002Bishwajeet/awesome-appwrite-snippets/5bd6120b234f0aefb952822f5c062eaab749e483/.github/images/awesome-appwrite-logo.png -------------------------------------------------------------------------------- /.github/images/awesome-badge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2002Bishwajeet/awesome-appwrite-snippets/5bd6120b234f0aefb952822f5c062eaab749e483/.github/images/awesome-badge.png -------------------------------------------------------------------------------- /.github/images/awesone-appwrite-snippets-banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2002Bishwajeet/awesome-appwrite-snippets/5bd6120b234f0aefb952822f5c062eaab749e483/.github/images/awesone-appwrite-snippets-banner.png -------------------------------------------------------------------------------- /.github/images/contributing.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2002Bishwajeet/awesome-appwrite-snippets/5bd6120b234f0aefb952822f5c062eaab749e483/.github/images/contributing.jpg -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: build 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | pull_request: 8 | release: 9 | types: 10 | - created 11 | 12 | jobs: 13 | build: 14 | runs-on: ubuntu-latest 15 | steps: 16 | - name: Checkout 17 | uses: actions/checkout@v3 18 | - name: Install Node.js 19 | uses: actions/setup-node@v3 20 | with: 21 | node-version: 16.x 22 | - run: npm install 23 | - name: Publish 24 | if: startsWith(github.ref, 'refs/tags/') 25 | run: yarn install && yarn upgrade && npm run deploy 26 | env: 27 | VSCE_PAT: ${{ secrets.VSCE_PAT }} 28 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | *.vsix 3 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | // A launch configuration that launches the extension inside a new window 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | { 6 | "version": "0.2.0", 7 | "configurations": [ 8 | { 9 | "name": "Extension", 10 | "type": "extensionHost", 11 | "request": "launch", 12 | "args": [ 13 | "--extensionDevelopmentPath=${workspaceFolder}" 14 | ] 15 | } 16 | ] 17 | } -------------------------------------------------------------------------------- /.vscodeignore: -------------------------------------------------------------------------------- 1 | .vscode/** 2 | .vscode-test/** 3 | .gitignore 4 | vsc-extension-quickstart.md 5 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | All notable changes to the "awesome-appwrite-snippets" extension will be documented in this file. 4 | 5 | 6 | 7 | 10 | 11 | ## [0.10.0] - 2022-11-13 12 | ## What's Changed 13 | * Feat: Add account snippet of Dart by @Rajat379 in https://github.com/2002Bishwajeet/awesome-appwrite-snippets/pull/19 14 | * Feat: PHP HealthAPI snippets by @Meldiron in https://github.com/2002Bishwajeet/awesome-appwrite-snippets/pull/18 15 | * Feat functions api javascript lang snippet by @RJ025 in https://github.com/2002Bishwajeet/awesome-appwrite-snippets/pull/25 16 | * Feat: Add Client and Account API Snippets for Kotlin Serverside by @adityaoberai in https://github.com/2002Bishwajeet/awesome-appwrite-snippets/pull/29 17 | * Feat apple client snippets by @GunjanGupta26 in https://github.com/2002Bishwajeet/awesome-appwrite-snippets/pull/26 18 | * feat:Android (Java) Client Snippets by @GunjanGupta26 in https://github.com/2002Bishwajeet/awesome-appwrite-snippets/pull/27 19 | * Fix: Correct Dart Get Session By ID snippet by @adityaoberai in https://github.com/2002Bishwajeet/awesome-appwrite-snippets/pull/28 20 | * Fix: Correct Flutter Teams API snippets by @adityaoberai in https://github.com/2002Bishwajeet/awesome-appwrite-snippets/pull/33 21 | * Feat: Add Kotlin Team and Heath API snippets by @adityaoberai in https://github.com/2002Bishwajeet/awesome-appwrite-snippets/pull/34 22 | * feat: NodeJS client snippets by @2002Bishwajeet in https://github.com/2002Bishwajeet/awesome-appwrite-snippets/pull/36 23 | 24 | ## New Contributors 25 | * @Rajat379 made their first contribution in https://github.com/2002Bishwajeet/awesome-appwrite-snippets/pull/19 26 | * @Meldiron made their first contribution in https://github.com/2002Bishwajeet/awesome-appwrite-snippets/pull/18 27 | * @RJ025 made their first contribution in https://github.com/2002Bishwajeet/awesome-appwrite-snippets/pull/25 28 | * @adityaoberai made their first contribution in https://github.com/2002Bishwajeet/awesome-appwrite-snippets/pull/29 29 | * @GunjanGupta26 made their first contribution in https://github.com/2002Bishwajeet/awesome-appwrite-snippets/pull/26 30 | 31 | **Full Changelog**: https://github.com/2002Bishwajeet/awesome-appwrite-snippets/compare/v0.3.0...v.0.10.0 32 | 33 | ## [0.3.0] - 2022-10-06 34 | ## What's Changed 35 | * Added GitHub issue forms by @Nikhil-1503 in https://github.com/2002Bishwajeet/awesome-appwrite-snippets/pull/13 36 | * Pull Request template by @Pranjalmishra30 in https://github.com/2002Bishwajeet/awesome-appwrite-snippets/pull/14 37 | * docs: add Nikhil-1503 as a contributor for maintenance by @allcontributors in https://github.com/2002Bishwajeet/awesome-appwrite-snippets/pull/15 38 | * docs: add Pranjalmishra30 as a contributor for maintenance by @allcontributors in https://github.com/2002Bishwajeet/awesome-appwrite-snippets/pull/16 39 | * Fix: broken snippets flutter by @2002Bishwajeet in https://github.com/2002Bishwajeet/awesome-appwrite-snippets/pull/17 40 | 41 | ## New Contributors 42 | * @Nikhil-1503 made their first contribution in https://github.com/2002Bishwajeet/awesome-appwrite-snippets/pull/13 43 | * @Pranjalmishra30 made their first contribution in https://github.com/2002Bishwajeet/awesome-appwrite-snippets/pull/14 44 | * @allcontributors made their first contribution in https://github.com/2002Bishwajeet/awesome-appwrite-snippets/pull/15 45 | 46 | **Full Changelog**: https://github.com/2002Bishwajeet/awesome-appwrite-snippets/compare/v0.2.0...v0.3.0 47 | 48 | ## [0.2.0] - 2022-09-29 49 | ## What's Changed 50 | * [ImgBot] Optimize images by @imgbot in https://github.com/2002Bishwajeet/awesome-appwrite-snippets/pull/5 51 | * Add Badges by @2002Bishwajeet in https://github.com/2002Bishwajeet/awesome-appwrite-snippets/pull/7 52 | * Feat 1.0.0 hacktoberfest by @2002Bishwajeet in https://github.com/2002Bishwajeet/awesome-appwrite-snippets/pull/8 53 | 54 | 55 | **Full Changelog**: https://github.com/2002Bishwajeet/awesome-appwrite-snippets/compare/v0.1.0...v0.2.0 56 | 57 | ## [0.1.0] - 2022-07-23 58 | 59 | ## What's Changed 60 | 61 | - Update readme and minor snippet changes by @2002Bishwajeet in https://github.com/2002Bishwajeet/awesome-appwrite-snippets/pull/4 62 | 63 | **Full Changelog**: https://github.com/2002Bishwajeet/awesome-appwrite-snippets/compare/v0.0.2...v0.1.0 64 | 65 | ## [0.0.2] - 2022-07-16 66 | 67 | ### What's Changed 68 | 69 | - Feat: web snippets by @2002Bishwajeet in https://github.com/2002Bishwajeet/awesome-appwrite-snippets/pull/3 70 | 71 | ### New Contributors 72 | 73 | - @2002Bishwajeet made their first contribution in https://github.com/2002Bishwajeet/awesome-appwrite-snippets/pull/3 74 | 75 | **Full Changelog**: https://github.com/2002Bishwajeet/awesome-appwrite-snippets/compare/v0.0.1...v0.0.2 76 | 77 | ## [0.0.1] - 2022-03-02 78 | 79 | - Initial release 80 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as 6 | contributors and maintainers pledge to make participation in our project and 7 | our community a harassment-free experience for everyone, regardless of age, body 8 | size, disability, ethnicity, sex characteristics, gender identity, expression, 9 | level of experience, education, socio-economic status, nationality, personal 10 | appearance, race, religion, or sexual identity and orientation. 11 | 12 | ## Our Standards 13 | 14 | Examples of behavior that contributes to creating a positive environment 15 | include: 16 | 17 | * Using welcoming and inclusive language 18 | * Being respectful of differing viewpoints and experiences 19 | * Gracefully accepting constructive criticism 20 | * Focusing on what is best for the community 21 | * Showing empathy towards other community members 22 | 23 | Examples of unacceptable behavior by participants include: 24 | 25 | * The use of sexualized language or imagery and unwelcome sexual attention or 26 | advances 27 | * Trolling, insulting/derogatory comments, and personal or political attacks 28 | * Public or private harassment 29 | * Publishing others' private information, such as a physical or electronic 30 | address, without explicit permission 31 | * Other conduct which could reasonably be considered inappropriate in a 32 | professional setting 33 | 34 | ## Our Responsibilities 35 | 36 | Project maintainers are responsible for clarifying the standards of acceptable 37 | behavior and are expected to take appropriate and fair corrective action in 38 | response to any instances of unacceptable behavior. 39 | 40 | Project maintainers have the right and responsibility to remove, edit, or 41 | reject comments, commits, code, wiki edits, issues, and other contributions 42 | that are not aligned to this Code of Conduct, or to ban temporarily or 43 | permanently any contributor for other behaviors that they deem inappropriate, 44 | threatening, offensive, or harmful. 45 | 46 | ## Scope 47 | 48 | This Code of Conduct applies both within project spaces and in public spaces 49 | when an individual is representing the project or its community. Examples of 50 | representing a project or community include using an official project e-mail 51 | address, posting via an official social media account, or acting as an appointed 52 | representative at an online or offline event. Representation of a project may be 53 | further defined and clarified by project maintainers. 54 | 55 | ## Enforcement 56 | 57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 58 | reported by contacting the project team at team@appwrite.io. All 59 | complaints will be reviewed and investigated and will result in a response that 60 | is deemed necessary and appropriate to the circumstances. The project team is 61 | obligated to maintain confidentiality with regard to the reporter of an incident. 62 | Further details of specific enforcement policies may be posted separately. 63 | 64 | Project maintainers who do not follow or enforce the Code of Conduct in good 65 | faith may face temporary or permanent repercussions as determined by other 66 | members of the project's leadership. 67 | 68 | ## Attribution 69 | 70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, 71 | available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html 72 | 73 | [homepage]: https://www.contributor-covenant.org 74 | 75 | For answers to common questions about this code of conduct, see 76 | https://www.contributor-covenant.org/faq -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | ![algo girl](.github/images/contributing.jpg) 4 | 5 | We would ❤️ for you to contribute to this Awesome Appwrite Snippets Project and help make it better! We want contributing to this repo to be fun, enjoyable, and educational for anyone and everyone. All contributions are welcome, including issues, doc improvements as well as updates and tweaks. 6 | 7 | ## How to Start? 8 | 9 | If you are worried or don’t know where to start, check out our next section explaining what kind of help we could use and where can you get involved. You can reach out with questions to [Bishwajeet Parhi (@biswa_20p)](https://twitter.com/biswa_20p) on Twitter or join the [Appwrite Discord Server](https://discord.gg/es7NYxsrR9) and you can ask there. You can also submit an issue, and a maintainer can guide you! 10 | 11 | ## Code of Conduct 12 | 13 | Help us keep Awesome Appwrite Snippets Project open and inclusive. Please read and follow our [Code of Conduct](CODE_OF_CONDUCT.md). 14 | 15 | ### Installing Locally 16 | 17 | Fork the repository. Make sure you have Node.js (LTS version) installed. 18 | 19 | ```bash 20 | git clone 21 | 22 | cd 23 | 24 | npm install # Install the dependencies 25 | 26 | code . # Open the project in your code editor 27 | 28 | ``` 29 | 30 | ### Creating a Pull Request 31 | 32 | ```bash 33 | git checkout -b 34 | # Fix some code... 35 | 36 | git commit -m "Fix typo in README.md" 37 | 38 | git push origin 39 | 40 | ``` 41 | 42 | The commit naming follows [this structure](https://cbea.ms/git-commit/) 43 | 44 | ### To add new snippets 45 | 46 | 1. Create a new file in the `snippets` directory of the format `.code-snippets`. If the name convention exists already, just add them in that file. 47 | 2. To add a new snippet, replace the following skeletion code. 48 | 49 | ```jsonc 50 | 51 | "snippetName": { 52 | "scope" : "", // Add the language scope here. For e.g `dart` 53 | "prefix" : "", // Add the prefix which tells vscode that this snippet is being called 54 | "body" : "", // Add the snippet body here. 55 | "description": "" // Add the snippet description here. 56 | } 57 | ``` 58 | Follow this [page](https://code.visualstudio.com/docs/editor/userdefinedsnippets#_create-your-own-snippets) to create snippet body. 59 | 60 | 3. If you created a new file, declare its language scope and path in the `package.json` under `snippets` array. 61 | 62 | ```jsonc 63 | "contributes": { 64 | "snippets": [ 65 | // ... more snippets 66 | { 67 | "language": "language", 68 | "path": "./snippets/path-to-snippets" 69 | }, 70 | ] 71 | } 72 | 73 | ``` 74 | 75 | 4. Once added don't forget to test it locally. Press `F5` to debug. It will open a new vscode window and try testing your snippets in the files. 76 | 77 | 5. Once tested, commit changes, push to the repository and open a pull request. 78 | 79 | ## Other Ways to Help 80 | 81 | Pull requests are great, but there are many other areas where you can help on this Project. 82 | 83 | ### Sending Feedbacks & Reporting Bugs 84 | 85 | Sending feedback is a great way for us to know how do you liked this project. If you had any issues, bugs, or want to share about your experience, feel free to do so on our GitHub issues page. 86 | 87 | ### Improving Documentation 88 | 89 | Submitting documentation updates, enhancements, designs, or bug fixes. Spelling or grammar fixes will be very much appreciated. 90 | 91 | ### Showcasing 92 | 93 | You can also give a shoutout to this project on your blog, website, or in you social handles tagging [Bishwajeet Parhi (@biswa_20p)](https://twitter.com/biswa_20p) and demonstrating the use of the snippets in your appwrite projects. 94 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2022 Bishwajeet Parhi 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Awesome Appwrite Snippets [![Awesome](.github/images/awesome-badge.png)](https://github.com/sindresorhus/awesome) 2 | 3 | [![All Contributors](https://img.shields.io/badge/all_contributors-7-orange.svg?style=flat-square)](#contributors-) 4 | 5 | 6 | Awesome Appwrite Snippets is a collection of commonly used Appwrite APIs. It increases your speed of development by eliminating most of the boilerplate code associated with making using Appwrite in your Project. 7 | 8 |
9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | ![Appwrite Logo](.github/images/awesone-appwrite-snippets-banner.png) 17 | 18 | ## Index 19 | 20 | - [What is Appwrite](#what-is-appwrite) 21 | - [Roadmap](#roadmap) 22 | - [Client Side](#client-side) 23 | - [Server Side](#server-side) 24 | - [Rest API Snippets](#rest-api-snippets) 25 | - [Client](#client) 26 | - [Account](#account) 27 | - [Databases](#databases) 28 | - [Storage](#storage) 29 | - [Teams](#teams) 30 | - [Health](#health) 31 | - [Functions](#functions) 32 | - [Known Issues](#known-issues) 33 | - [Contributing](#contributing) 34 | - [License](#license) 35 | 36 | ## What is Appwrite? 37 | 38 | Appwrite is a self-hosted backend-as-a-service platform that provides developers with all the core APIs required to build any application. 39 | To know more about appwrite, visit their [official website](https://appwrite.io). 40 | 41 | ## Roadmap 42 | 43 | The following tables portrays the snippets of the following Appwrite API in their particular language is supported for now. 44 | 45 | ### Client Side 46 | 47 | | REST APIs | Flutter SDK | Web SDK | Apple SDK | Android SDK (Java) | Android SDK (Kotlin) | 48 | | :-----------: | ----------- | ------- | --------- | ------------------ | -------------------- | 49 | | Client | ✅ | ✅ | ✅ | ✅ | | 50 | | Account | ✅ | ✅ | | | | 51 | | Database | ✅ | ✅ | | | | 52 | | Storage | ✅ | ✅ | | | | 53 | | Teams | ✅ | ✅ | | | | 54 | | Functions | | ✅ | | | | 55 | | Localizations | | | | | | 56 | | Avatars | | | | | | 57 | 58 | ### Server Side 59 | 60 | | REST APIs | Dart | Node.js | Swift | Deno | Python | Ruby | PHP | Kotlin | 61 | | :-----------: | ---- | ------- | ----- | ---- | ------ | ---- | --- | ------ | 62 | | Client | ✅ | ✅ | | | | | | ✅ | 63 | | Account | ✅ | | | | | | | ✅ | 64 | | Database | | | | | | | | | 65 | | Storage | | | | | | | | | 66 | | Teams | | | | | | | | ✅ | 67 | | Functions | | | | | | | | | 68 | | Localizations | | | | | | | | | 69 | | Avatars | | | | | | | | | 70 | | Health | | | | | | | ✅ | ✅ | 71 | | Users | | | | | | | | | 72 | 73 | These snippets supports for the appwrite version ![Appwrite Version](https://img.shields.io/badge/appwrite-v1.1.0-%23f02e65) 74 | 75 | ## Rest API Snippets 76 | 77 | The Appwrite API is organized around REST. Their API has predictable resource-oriented URLs, accepts form-encoded or JSON-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs. 78 | 79 | ### Client 80 | 81 | | Shortcut | Description | 82 | | :-------: | ----------------------------------------------- | 83 | | `client` | Create a Client object and initialize it | 84 | | `sclient` | Create a server Client object and initialize it | 85 | 86 | ### Account 87 | 88 | The Account service allows you to authenticate and manage a user account. You can use the account service to update user information, retrieve the user sessions across different devices, and fetch the user security logs with his or her recent activity. To know more about Accounts API, head over this [page](https://appwrite.io/docs/client/account) 89 | 90 | | Shortcut | Description | 91 | | :-----------------------------------------------------------: | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | 92 | | `account` | Create and Account object and initialize it | 93 | | `crAccount`, `createAccount` | Allow a new user to register a new account in your project. | 94 | | `crsessionOAuth2` | Create a new Account session with OAuth2 | 95 | | `magicUrl`, `mgURLSession` | 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. | 96 | | `upMagicUrl`, `updatemagicUrl`, `mgURLSession` | Update Magic URL session | 97 | | `crsPhone`, `createPhoneSession` | Create a new Phone session | 98 | | `upPhone`, `updatePhoneSession` | Update the Phone session | 99 | | `crsAccount`, `crAnonymous`, `createAnonymousSession` | Create a new Anonymous Session | 100 | | `crJWT`, `JWT` | Create a new Account using JWT | 101 | | `getAccount` | Get currently logged in user data as JSON object. | 102 | | `getAccountPreferences`, `getAccPrefs` | Get currently logged in user preferences as a key-value object. | 103 | | `getAccountSession`, `getAccSession` | Get currently logged in user list of active sessions across different devices. | 104 | | `getAccountLogs`, `getAccLog` | Get currently logged in user list of latest security activity logs. Each log returns user IP address, location and date and time of log. | 105 | | `getSessionId`, `getSessionbyId` | Use this endpoint to get a logged in user's session using a Session ID. Inputting 'current' will return the current session being used. | 106 | | `updateName`, `upName` | Update currently logged in user account name. | 107 | | `updatePassword`, `upPass` | 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. | 108 | | `updateEmail`, `upEmail` | 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. | 109 | | `upPrefs`, `upPref` | 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. | 110 | | `deleteAccount`, `delAcc` | 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. | 111 | | `deleteAccountSession`, `delAccSession` | 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 option id argument, only the session unique ID provider will be deleted. | 112 | | `deleteAccountSessions`, `delAccSessions` | Delete all sessions from the user account and remove any sessions cookies from the end client. | 113 | | `recPassword`, `crRecovery` | 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 endpoint to complete the process. The verification link sent to the user's email address is valid for 1 hour. | 114 | | `upRecovery`, `updateRecovery` | 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 endpoint to complete the process. The verification link sent to the user's email address is valid for 1 hour. | 115 | | `emailVerification`, `crEmailVerification` | 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. The verification link sent to the user's email address is valid for 7 days. | 116 | | `emailVerificationconfirmation`, `crEmailVerificationconfirm` | 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. | 117 | | `phoneVerification`, `crPhoneVerification` | Use this endpoint to send a verification SMS to the currently logged in user. This endpoint is meant for use after updating a user's phone number using the accountUpdatePhone endpoint. Learn more about how to complete the verification process. The verification code sent to the user's phone number is valid for 15 minutes. | 118 | | `phoneVerificationconfirmation`, `crPhoneVerificationconfirm` | Use this endpoint to complete the user phone verification process. Use the userId and secret that were sent to your user's phone number to verify the user email ownership. If confirmed this route will return a 200 status code. | 119 | 120 | ### Databases 121 | 122 | The Databases service allows you to create structured collections of documents, query and filter lists of documents, and manage an advanced set of read and write access permissions. 123 | 124 | All data returned by the Databases service are represented as structured JSON documents. To know more about Databases API, head over this [page](https://appwrite.io/docs/client/databases) 125 | 126 | | Shortcut | Description | 127 | | -------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | 128 | | `database` | Create a Database object and initialize it. | 129 | | `crdoc`, `crDocument` | Create a new Document. Before using this route, you should create a new collection resource using either a server integration API or directly from your database console. | 130 | | `lsdoc`, `lsd` | Get a list of all the user documents. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project's documents. | 131 | | `getDocument` | Get a document by its unique ID. This endpoint response returns a JSON object with the document data. | 132 | | `updateDocument` | Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated. | 133 | | `deleteDocument`, `deldoc` | Delete a document by its unique ID. This endpoint deletes only the parent documents, its attributes and relations to other documents. Child documents will not be deleted. | 134 | 135 | ### Storage 136 | 137 | The Storage service allows you to manage your project files. Using the Storage service, you can upload, view, download, and query all your project files. 138 | To know more about Storage API, head over this [page](https://appwrite.io/docs/client/storage) 139 | 140 | | Shortcut | Description | 141 | | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | 142 | | `storage` | Create a Database object and initialize it. | 143 | | `createFile` | Create a new file. The user who creates the file will automatically be assigned to read and write access unless he has passed custom values for read and write arguments. | 144 | | `listFiles` | Get a list of all the user files. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project's files. | 145 | | `getFile` | Get a file by its unique ID. | 146 | | `getFilePreview` | Get a file preview by its unique ID. | 147 | | `getFileForDownload` | Get a file for download by its unique ID. | 148 | | `getFileForView` | Get a file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header. | 149 | | `updateFile` | Update a file by its unique ID. Only users with write permissions have access to update this resource. | 150 | | `deleteFile` | Delete a file by its unique ID. Only users with write permissions have access to delete this resource. | 151 | 152 | ### Teams 153 | 154 | The Teams service allows you to group users of your project and to enable them to share read and write access to your project resources, such as database documents or storage files. 155 | To know more about Teams API, head over this [page](https://appwrite.io/docs/client/teams) 156 | 157 | | Shortcut | Description | 158 | | ------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | 159 | | `team` | Create a Team object and initialize it. | 160 | | `createTeam`, `crTeam` | Create a new Team. | 161 | | `listTeams`, `listTeams` | Get a list of all the user teams. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project's teams. | 162 | | `getTeam` | Get a team by its unique ID. | 163 | | `updateTeam`,`upTeam` | Update a team by its unique ID. | 164 | | `deleteTeam`, `delTeam` | Delete a team by its unique ID. | 165 | | `createTeamMembership`, `crTeamMembership` | Create a new Team Membership. | 166 | | `getTeamMembership`, `gtmembership` | Get a team membership by its unique ID. | 167 | | `updateTeamMembershiproles` | Modify the roles of a team member. Only team members with the owner role have access to this endpoint. | 168 | | `updateTeamMembershipstatus` | Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user. | 169 | | `deleteTeamMembership`, `delTeamMembership` | This endpoint allows a user to leave a team or for a team owner to delete the membership of any other team member. You can also use this endpoint to delete a user membership even if it is not accepted. | 170 | 171 | ### Health 172 | 173 | The Health service is designed to allow you to both validate and monitor that your Appwrite server instance and all of its internal components are up and responsive. 174 | To know more about Health API, head over this [page](https://appwrite.io/docs/server/health) 175 | 176 | | Shortcut | Description | 177 | | ------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | 178 | | `health` | Create a Health object and initialize it. | 179 | | `getHttp`, `getHealth` | Check the Appwrite HTTP server is up and responsive. | 180 | | `getDbHealth`, `getDatabaseHealth` | Check the Appwrite database server is up and connection is successful. | 181 | | `getCacheHealth` | Check the Appwrite in-memory cache server is up and connection is successful. | 182 | | `getTime`,`getTimeHealth` | Check the Appwrite server time is synced with Google remote NTP server. | 183 | | `getWebhooksQueue`, `getWhQueue`, `getQueueWebhooks` | Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server. | 184 | | `getLogsQueue`, `getQueueLogs` | Get the number of logs that are waiting to be processed in the Appwrite internal queue server. | 185 | | `getCertificatesQueue`, `getCertsQueue`, `getQueueCertificates` | Get the number of certificates that are waiting to be issued against Letsencrypt in the Appwrite internal queue server. | 186 | | `getFuncsQueue`, `getFunctionsQueue`, `getQueueFunctions` | Get the number of function executions that are waiting to be executed. | 187 | | `getStorageHealth`, `getStorageLocal` | Check the Appwrite local storage device is up and connection is successful. | 188 | | `getAntivirusHealth`, `getAntivirus` | Check the Appwrite Antivirus server is up and connection is successful. | 189 | 190 | ### Functions 191 | 192 | The Functions service allows you to create custom behaviour that can be triggered by any supported Appwrite system events or by a predefined schedule.To know more about Functions API, head over to this [page](https://appwrite.io/docs/client/functions) 193 | 194 | | Shortcut | Description | 195 | |------------|------------------------------------------------------------------------------------------------| 196 | | `createfunc` | Create a new function object and initialize it. | 197 | | `execfunc` | Trigger a function execution.The returned object will return you the current execution status. | 198 | | `listfunc` | Get a list of all the current user function execution logs. | 199 | | `getfunc` | Get a function execution log by its unique ID. | 200 | 201 | 202 | 203 | ## Known Issues 204 | 205 | At this time, there are no known issues. If you discover a bug or would like to see a shortcut added, please create a pull request at our GitHub page. 206 | 207 | ## Contributing 208 | 209 | Contributions are highly Welcomed 💙 . Feel free to open PRs for small issues such as typos. For large issues or features, please open an issue and wait for it to be assigned to you. 210 | 211 | See [`contributing.md`](CONTRIBUTING.md) for ways to get started. 212 | 213 | Please adhere to this project's [Code of Conduct](CODE_OF_CONDUCT.md). 214 | 215 | ## License 216 | 217 | This project is MIT licensed. See [`LICENSE`](LICENSE) for more details 218 | 219 | ## Contributors ✨ 220 | 221 | Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)): 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 |
Nikhil Shanbhag
Nikhil Shanbhag

🚧
Pranjal Mishra
Pranjal Mishra

🚧
Rajat379
Rajat379

💻
Matej Bačo
Matej Bačo

💻 📖
RITIK JAIN
RITIK JAIN

💻 📖
Aditya Oberai
Aditya Oberai

💻 🐛
Gunjan Gupta
Gunjan Gupta

💻
239 | 240 | 241 | 242 | 243 | 244 | 245 | This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! 246 | -------------------------------------------------------------------------------- /logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/2002Bishwajeet/awesome-appwrite-snippets/5bd6120b234f0aefb952822f5c062eaab749e483/logo.png -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "awesome-appwrite-snippets", 3 | "displayName": "Awesome Appwrite Snippets", 4 | "description": "Awesome Appwrite Snippets is a collection snippets and shortcuts of commonly used Appwrite APIs ", 5 | "version": "0.10.0", 6 | "icon": "logo.png", 7 | "publisher": "Biswa", 8 | "engines": { 9 | "vscode": "^1.60.0" 10 | }, 11 | "keywords": [ 12 | "Snippets", 13 | "Appwrite", 14 | "Awesome Appwrite Snippets" 15 | ], 16 | "categories": [ 17 | "Snippets" 18 | ], 19 | "homepage": "https://github.com/2002Bishwajeet/awesome-appwrite-snippets", 20 | "repository": { 21 | "type": "git", 22 | "url": "https://github.com/2002Bishwajeet/awesome-appwrite-snippets.git" 23 | }, 24 | "bugs": { 25 | "url": "https://github.com/2002Bishwajeet/awesome-appwrite-snippets/issues", 26 | "email": "bishwajeet.techmaster@gmail.com" 27 | }, 28 | "scripts": { 29 | "deploy": "vsce publish --yarn" 30 | }, 31 | "contributes": { 32 | "snippets": [ 33 | { 34 | "language": "dart", 35 | "path": "./snippets/flutter/client.code-snippets" 36 | }, 37 | { 38 | "language": "dart", 39 | "path": "./snippets/dart/client.code-snippets" 40 | }, 41 | { 42 | "language": "javascript", 43 | "path": "./snippets/web/client.code-snippets" 44 | }, 45 | { 46 | "language": "javascript", 47 | "path": "./snippets/javascript/client.code-snippets" 48 | }, 49 | { 50 | "language": "dart", 51 | "path": "./snippets/flutter/account.code-snippets" 52 | }, 53 | { 54 | "language": "javascript", 55 | "path": "./snippets/web/account.code-snippets" 56 | }, 57 | { 58 | "language": "dart", 59 | "path": "./snippets/flutter/database.code-snippets" 60 | }, 61 | { 62 | "language": "javascript", 63 | "path": "./snippets/web/database.code-snippets" 64 | }, 65 | { 66 | "language": "dart", 67 | "path": "./snippets/flutter/storage.code-snippets" 68 | }, 69 | { 70 | "language": "javascript", 71 | "path": "./snippets/web/storage.code-snippets" 72 | }, 73 | { 74 | "language": "java", 75 | "path": "./snippets/android_java/client.code-snippets" 76 | }, 77 | { 78 | "language": "dart", 79 | "path": "./snippets/flutter/teams.code-snippets" 80 | }, 81 | { 82 | "language": "javascript", 83 | "path": "./snippets/web/functions.code-snippets" 84 | }, 85 | { 86 | "language": "dart", 87 | "path": "./snippets/dart/account.code-snippets" 88 | }, 89 | { 90 | "language": "swift", 91 | "path": "./snippets/apple/client.code-snippets" 92 | }, 93 | { 94 | "language": "php", 95 | "path": "./snippets/php/health.code-snippets" 96 | }, 97 | { 98 | "language": "kotlin", 99 | "path": "./snippets/kotlin/client.code-snippets" 100 | }, 101 | { 102 | "language": "kotlin", 103 | "path": "./snippets/kotlin/account.code-snippets" 104 | }, 105 | { 106 | "language": "kotlin", 107 | "path": "./snippets/kotlin/teams.code-snippets" 108 | }, 109 | { 110 | "language": "kotlin", 111 | "path": "./snippets/kotlin/health.code-snippets" 112 | } 113 | ] 114 | }, 115 | "dependencies": { 116 | "xvfb": "^0.4.0" 117 | }, 118 | "sponsor": { 119 | "url": "https://github.com/sponsors/2002bishwajeet" 120 | }, 121 | "devDependencies": { 122 | "vsce": "^2.11.0" 123 | }, 124 | "license": "MIT" 125 | } 126 | -------------------------------------------------------------------------------- /snippets/android_java/client.code-snippets: -------------------------------------------------------------------------------- 1 | { 2 | "Add a Client": { 3 | "scope": "java", 4 | "prefix": "client", 5 | "body": [ 6 | "Client ${1:client} = Client(getApplicationContext())", 7 | "\t.setEndpoint(${2:https:/appwrite.io/v1})", 8 | "\t.setProject(${3:project_id})", 9 | ], 10 | "description": "Create a Client object and initialize it." 11 | } 12 | } -------------------------------------------------------------------------------- /snippets/apple/client.code-snippets: -------------------------------------------------------------------------------- 1 | { 2 | "Add a Client": { 3 | "scope" : "swift", 4 | "prefix" : "client", 5 | "body" : [ 6 | "let ${1:client} = Client()", 7 | "\t.setEndpoint(${2:https:/appwrite.io/v1})", 8 | "\t.setProject(${3:project_id})", 9 | ], 10 | "description": "Add a client object and initialise it" 11 | } 12 | } -------------------------------------------------------------------------------- /snippets/dart/account.code-snippets: -------------------------------------------------------------------------------- 1 | { 2 | "Initialize account": { 3 | "scope": "dart", 4 | "prefix": ["sAccount"], 5 | "body": ["final Account ${1:account} = ${2:client};"], 6 | "description": "Create a Account object and initialize it." 7 | }, 8 | 9 | "Update Phone session": { 10 | "scope": "dart", 11 | "prefix": ["sUpPhone", "sUpdatePhoneSession"], 12 | "body": [ 13 | "final ${1:response} = await account.updatePhoneSession(userId: '${2:unique()}', number: '${3:number');" 14 | ], 15 | "description": "Update the Phone session" 16 | }, 17 | 18 | "Get Account": { 19 | "scope": "dart", 20 | "prefix": ["sGetAccount"], 21 | "body": ["final ${1:user} = await account.get();"], 22 | "description": "Get currently logged in user data as JSON object." 23 | }, 24 | 25 | "Get Account Preferences": { 26 | "scope": "dart", 27 | "prefix": ["sGetAccountPreferences", "sGetAccPrefs"], 28 | "body": ["final ${1:response} = await account.getPrefs();"], 29 | "description": "Get currently logged in user preferences as a key-value object." 30 | }, 31 | 32 | "Get Account Sessions": { 33 | "scope": "dart", 34 | "prefix": ["sGetAccountSession", "sGetAccSession"], 35 | "body": ["final ${1:response} = await account.getSessions();"], 36 | "description": "Get currently logged in user list of active sessions across different devices." 37 | }, 38 | 39 | "Get Account Logs": { 40 | "scope": "dart", 41 | "prefix": ["sGetAccountLogs", "sGetAccLog"], 42 | "body": ["final ${1:response} = await account.getLogs();"], 43 | "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." 44 | }, 45 | 46 | "Get Session by ID": { 47 | "scope": "dart", 48 | "prefix": ["sGetSessionId", "sGetSessionbyId"], 49 | "body": [ 50 | "final ${1:response} = await account.getSession(sessionId: '${2:sessionId}');" 51 | ], 52 | "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." 53 | }, 54 | 55 | "Update Account Name": { 56 | "scope": "dart", 57 | "prefix": ["sUpdateName", "sUpName"], 58 | "body": [ 59 | "final ${1:response} = await account.updateName(name: '${2:name}');" 60 | ], 61 | "description": "Update currently logged in user account name." 62 | }, 63 | 64 | "Update Account Password": { 65 | "scope": "dart", 66 | "prefix": ["sUpdatePassword", "sUpPass"], 67 | "body": [ 68 | "final ${1:response} = await account.updatePassword(password: '${2:password}');" 69 | ], 70 | "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." 71 | }, 72 | 73 | "Update Account Email": { 74 | "scope": "dart", 75 | "prefix": ["sUpdateEmail", "sUpEmail"], 76 | "body": [ 77 | "final ${1:response} = await account.updateEmail(email: '${2:email}', password: '${3:password}');" 78 | ], 79 | "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." 80 | }, 81 | 82 | "Update Account Preferences": { 83 | "scope": "dart", 84 | "prefix": ["sUpPrefs", "sUpPref"], 85 | "body": ["final ${1:response} = await account.updatePrefs(prefs: {$2});"], 86 | "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." 87 | }, 88 | 89 | 90 | "Delete Account Session": { 91 | "scope": "dart", 92 | "prefix": ["sDeleteAccountSession", "sDelAccSession"], 93 | "body": ["await account.deleteSession(sessionId: '${1:sessionId}');"], 94 | "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 option id argument, only the session unique ID provider will be deleted." 95 | }, 96 | 97 | "Delete All Account Sessions": { 98 | "scope": "dart", 99 | "prefix": ["sDeleteAccountSessions", "sDelAccSessions"], 100 | "body": ["await account.deleteSessions();"], 101 | "description": "Delete all sessions from the user account and remove any sessions cookies from the end client." 102 | }, 103 | 104 | "Create Password Recovery": { 105 | "scope": "dart", 106 | "prefix": ["sRecPassword", "sCrRecovery"], 107 | "body": [ 108 | "final ${1:response} = await account.createRecovery(email: '${2:email}', url:'${3:url}');" 109 | ], 110 | "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 endpoint to complete the process. The verification link sent to the user's email address is valid for 1 hour." 111 | }, 112 | 113 | "Create Password Recovery(confirmation)": { 114 | "scope": "dart", 115 | "prefix": ["sUpRecovery", "sUpdateRecovery"], 116 | "body": [ 117 | "final ${1:response} = await account.updateRecovery(userId: '${2:unique()}', secret:'${3:secret}',password: '${4:password}',passwordAgain:'${5:password}');" 118 | ], 119 | "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 endpoint to complete the process. The verification link sent to the user's email address is valid for 1 hour." 120 | }, 121 | 122 | "Create Email Verification": { 123 | "scope": "dart", 124 | "prefix": ["sEmailVerification", "sCrEmailVerification"], 125 | "body": [ 126 | "final ${1:response} = await account.createVerification(url: '${2:url}');" 127 | ], 128 | "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. The verification link sent to the user's email address is valid for 7 days." 129 | }, 130 | 131 | "Create Email Verification(confirmation)": { 132 | "scope": "dart", 133 | "prefix": ["sEmailVerificationconfirmation", "sCrEmailVerificationconfirm"], 134 | "body": [ 135 | "final ${1:response} = await account.updateVerification(userId: '${2:unique()}',secret: '${3:secret}');" 136 | ], 137 | "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." 138 | }, 139 | 140 | "Create Phone Verification": { 141 | "scope": "dart", 142 | "prefix": ["sPhoneVerification", "sCrPhoneVerification"], 143 | "body": ["final ${1:response} = await account.createPhoneVerification();"], 144 | "description": "Use this endpoint to send a verification SMS to the currently logged in user. This endpoint is meant for use after updating a user's phone number using the accountUpdatePhone endpoint. Learn more about how to complete the verification process. The verification code sent to the user's phone number is valid for 15 minutes." 145 | }, 146 | 147 | "Create Phone Verification(confirmation)": { 148 | "scope": "dart", 149 | "prefix": ["sPhoneVerificationconfirmation", "sCrPhoneVerificationconfirm"], 150 | "body": [ 151 | "final ${1:response} = await account.updatePhoneVerification(userId: '${2:unique()}',secret: '${3:secret}');" 152 | ], 153 | "description": "Use this endpoint to complete the user phone verification process. Use the userId and secret that were sent to your user's phone number to verify the user email ownership. If confirmed this route will return a 200 status code." 154 | } 155 | } 156 | -------------------------------------------------------------------------------- /snippets/dart/client.code-snippets: -------------------------------------------------------------------------------- 1 | { 2 | "Add a Dart Client": { 3 | "scope": "dart", 4 | "prefix": "sclient", 5 | "body": [ 6 | "final Client ${1:client} = Client()", 7 | "\t.setEndpoint(${2:https:/appwrite.io/v1})", 8 | "\t.setProject(${3:project_id})", 9 | "\t.setKey('${4:');" 10 | ], 11 | "description": "Create a dart Client object and initialize it." 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /snippets/flutter/account.code-snippets: -------------------------------------------------------------------------------- 1 | { 2 | "Initialize account": { 3 | "scope": "dart", 4 | "prefix": ["account"], 5 | "body": ["final Account ${1:account} = Account(client);"], 6 | "description": "Create a Account object and initialize it." 7 | }, 8 | 9 | "Create account": { 10 | "scope": "dart", 11 | "prefix": ["crAccount", "createAccount"], 12 | "body": [ 13 | "final ${1:account} = await account.create(userId: '${2:unique()}', email: '${3:email}', password: '${4:password}');" 14 | ], 15 | "description": "Allow a new user to register a new account in your project." 16 | }, 17 | 18 | "Create account Session with Email": { 19 | "scope": "dart", 20 | "prefix": ["crsemail", "createEmailSession"], 21 | "body": [ 22 | "final ${1:session} = await account.createEmailSession( email: '${2:email}', password: '${3:password}');" 23 | ], 24 | "description": "Create a new Account Session" 25 | }, 26 | 27 | "Create account Session with OAuth2": { 28 | "scope": "dart", 29 | "prefix": ["crsessionOAuth2"], 30 | "body": [ 31 | "final ${1:response} = await account.createOAuth2Session(provider: '${2:provider}');" 32 | ], 33 | "description": "Create a new Account Session with OAuth2" 34 | }, 35 | 36 | "Create Magic Url session": { 37 | "scope": "dart", 38 | "prefix": ["magicUrl", "mgURLSession"], 39 | "body": [ 40 | "final ${1:response} = await account.createMagicURLSession(userId: '${1:unique()}', email: '${2:email}');" 41 | ], 42 | "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. " 43 | }, 44 | "Update Magic Url session": { 45 | "scope": "dart", 46 | "prefix": ["upMagicUrl", "updatemagicUrl", "mgURLSession"], 47 | "body": [ 48 | "final ${1:response} = await account.updateMagicURLSession(userId: '${2:unique()}', secret: '${3:secret-key}');" 49 | ], 50 | "description": "Update Magic URL session" 51 | }, 52 | 53 | "Create Phone session": { 54 | "scope": "dart", 55 | "prefix": ["crsPhone", "createPhoneSession"], 56 | "body": [ 57 | "final ${1:response} = await account.createPhoneSession(userId: '${2:unique()}', number: '${3:number}');" 58 | ], 59 | "description": "Create a new Phone session" 60 | }, 61 | 62 | "Update Phone session": { 63 | "scope": "dart", 64 | "prefix": ["upPhone", "updatePhoneSession"], 65 | "body": [ 66 | "final ${1:response} = await account.updatePhoneSession(userId: '${2:unique()}', number: '${3:number');" 67 | ], 68 | "description": "Update the Phone session" 69 | }, 70 | 71 | "Create Anonymous session": { 72 | "scope": "dart", 73 | "prefix": ["crsAccount", "crAnonymous", "createAnonymousSession"], 74 | "body": ["final ${1:response} = await account.createAnonymousSession();"], 75 | "description": "Create a new Anonymous Session" 76 | }, 77 | 78 | "Create JWT": { 79 | "scope": "dart", 80 | "prefix": ["crJWT", "JWT"], 81 | "body": ["final ${1:response} = await account.createJWT();"], 82 | "description": "Create a new Account using JWT" 83 | }, 84 | 85 | "Get Account": { 86 | "scope": "dart", 87 | "prefix": ["getAccount"], 88 | "body": ["final ${1:user} = await account.get();"], 89 | "description": "Get currently logged in user data as JSON object." 90 | }, 91 | 92 | "Get Account Preferences": { 93 | "scope": "dart", 94 | "prefix": ["getAccountPreferences", "getAccPrefs"], 95 | "body": ["final ${1:response} = await account.getPrefs();"], 96 | "description": "Get currently logged in user preferences as a key-value object." 97 | }, 98 | 99 | "Get Account Sessions": { 100 | "scope": "dart", 101 | "prefix": ["getAccountSession", "getAccSession"], 102 | "body": ["final ${1:response} = await account.getSessions();"], 103 | "description": "Get currently logged in user list of active sessions across different devices." 104 | }, 105 | 106 | "Get Account Logs": { 107 | "scope": "dart", 108 | "prefix": ["getAccountLogs", "getAccLog"], 109 | "body": ["final ${1:response} = await account.getLogs();"], 110 | "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." 111 | }, 112 | 113 | "Get Session by ID": { 114 | "scope": "dart", 115 | "prefix": ["getSessionId", "getSessionbyId"], 116 | "body": [ 117 | "final ${1:response} = await account.getSesssion(sessionId: '${1:sessionId}');" 118 | ], 119 | "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." 120 | }, 121 | 122 | "Update Account Name": { 123 | "scope": "dart", 124 | "prefix": ["updateName", "upName"], 125 | "body": [ 126 | "final ${1:response} = await account.updateName(name: '${2:name}');" 127 | ], 128 | "description": "Update currently logged in user account name." 129 | }, 130 | 131 | "Update Account Password": { 132 | "scope": "dart", 133 | "prefix": ["updatePassword", "upPass"], 134 | "body": [ 135 | "final ${1:response} = await account.updatePassword(password: '${2:password}');" 136 | ], 137 | "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." 138 | }, 139 | 140 | "Update Account Email": { 141 | "scope": "dart", 142 | "prefix": ["updateEmail", "upEmail"], 143 | "body": [ 144 | "final ${1:response} = await account.updateEmail(email: '${2:email}', password: '${3:password}');" 145 | ], 146 | "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." 147 | }, 148 | 149 | "Update Account Preferences": { 150 | "scope": "dart", 151 | "prefix": ["upPrefs", "upPref"], 152 | "body": ["final ${1:response} = await account.updatePrefs(prefs: {$2});"], 153 | "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." 154 | }, 155 | 156 | 157 | "Delete Account Session": { 158 | "scope": "dart", 159 | "prefix": ["deleteAccountSession", "delAccSession"], 160 | "body": ["await account.deleteSession(sessionId: '${1:sessionId}');"], 161 | "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 option id argument, only the session unique ID provider will be deleted." 162 | }, 163 | 164 | "Delete All Account Sessions": { 165 | "scope": "dart", 166 | "prefix": ["deleteAccountSessions", "delAccSessions"], 167 | "body": ["await account.deleteSessions();"], 168 | "description": "Delete all sessions from the user account and remove any sessions cookies from the end client." 169 | }, 170 | 171 | "Create Password Recovery": { 172 | "scope": "dart", 173 | "prefix": ["recPassword", "crRecovery"], 174 | "body": [ 175 | "final ${1:response} = await account.createRecovery(email: '${2:email}', url:'${3:url}');" 176 | ], 177 | "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 endpoint to complete the process. The verification link sent to the user's email address is valid for 1 hour." 178 | }, 179 | 180 | "Create Password Recovery(confirmation)": { 181 | "scope": "dart", 182 | "prefix": ["upRecovery", "updateRecovery"], 183 | "body": [ 184 | "final ${1:response} = await account.updateRecovery(userId: '${2:unique()}', secret:'${3:secret}',password: '${4:password}',passwordAgain:'${5:password}');" 185 | ], 186 | "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 endpoint to complete the process. The verification link sent to the user's email address is valid for 1 hour." 187 | }, 188 | 189 | "Create Email Verification": { 190 | "scope": "dart", 191 | "prefix": ["emailVerification", "crEmailVerification"], 192 | "body": [ 193 | "final ${1:response} = await account.createVerification(url: '${2:url}');" 194 | ], 195 | "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. The verification link sent to the user's email address is valid for 7 days." 196 | }, 197 | 198 | "Create Email Verification(confirmation)": { 199 | "scope": "dart", 200 | "prefix": ["emailVerificationconfirmation", "crEmailVerificationconfirm"], 201 | "body": [ 202 | "final ${1:response} = await account.updateVerification(userId: '${2:unique()}',secret: '${3:secret}');" 203 | ], 204 | "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." 205 | }, 206 | 207 | "Create Phone Verification": { 208 | "scope": "dart", 209 | "prefix": ["phoneVerification", "crPhoneVerification"], 210 | "body": ["final ${1:response} = await account.createPhoneVerification();"], 211 | "description": "Use this endpoint to send a verification SMS to the currently logged in user. This endpoint is meant for use after updating a user's phone number using the accountUpdatePhone endpoint. Learn more about how to complete the verification process. The verification code sent to the user's phone number is valid for 15 minutes." 212 | }, 213 | 214 | "Create Phone Verification(confirmation)": { 215 | "scope": "dart", 216 | "prefix": ["phoneVerificationconfirmation", "crPhoneVerificationconfirm"], 217 | "body": [ 218 | "final ${1:response} = await account.updatePhoneVerification(userId: '${2:unique()}',secret: '${3:secret}');" 219 | ], 220 | "description": "Use this endpoint to complete the user phone verification process. Use the userId and secret that were sent to your user's phone number to verify the user email ownership. If confirmed this route will return a 200 status code." 221 | } 222 | } 223 | -------------------------------------------------------------------------------- /snippets/flutter/client.code-snippets: -------------------------------------------------------------------------------- 1 | { 2 | /* -----------------------FLUTTER----------------------- */ 3 | 4 | "Add a Client": { 5 | "scope": "dart", 6 | "prefix": "client", 7 | "body": [ 8 | "final Client ${1:client} = Client()", 9 | "\t.setEndpoint(${2:https:/appwrite.io/v1})", 10 | "\t.setProject(${3:project_id})", 11 | "\t.setSelfSigned(status:$4);" 12 | ], 13 | "description": "Create a Client object and initialize it." 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /snippets/flutter/database.code-snippets: -------------------------------------------------------------------------------- 1 | { 2 | "Initialize Database": { 3 | "scope": "dart", 4 | "prefix": ["database"], 5 | "body": [ 6 | "final Database database = Database(client,databaseId = \"${1:databaseId}\" );" 7 | ], 8 | "description": "Create a Database object and initialize it." 9 | }, 10 | 11 | "Create Document": { 12 | "scope": "dart", 13 | "prefix": ["crdoc", "crDocument"], 14 | "body": [ 15 | "final ${1:response} = await database.createDocument(databaseId: \"${2:databaseId}\", collectionId: \"${3:collectionId}\", documentId: \"${4:documentId}\");" 16 | ], 17 | "description": "Create a new Document. Before using this route, you should create a new collection resource using either a server integration API or directly from your database console." 18 | }, 19 | 20 | "List Document": { 21 | "scope": "dart", 22 | "prefix": ["lsdoc", "lsd"], 23 | "body": [ 24 | "final ${1:response} = await database.listDocuments(databaseId: \"${2:databaseId}\",collectionId: \"${3:collectionId}\",);" 25 | ], 26 | "description": "Get a list of all the user documents. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project's documents." 27 | }, 28 | 29 | "Get Document": { 30 | "scope": "dart", 31 | "prefix": "getDocument", 32 | "body": [ 33 | "final ${1:response} = await database.getDocument(databaseId: \"${2:databaseId}\",collectionId: \"${3:collectionId}\", documentId: \"${4:documentId}\");" 34 | ], 35 | "description": "Get a document by its unique ID. This endpoint response returns a JSON object with the document data." 36 | }, 37 | 38 | "Update Document": { 39 | "scope": "dart", 40 | "prefix": ["updateDocument"], 41 | "body": [ 42 | "final ${1:response} = await database.updateDocument(databaseId: \"${2:databaseId}\",collectionId: \"${3:collectionId}\", documentId: \"${4:documentId}\", data: {$5});" 43 | ], 44 | "description": "Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated." 45 | }, 46 | 47 | "Delete Document": { 48 | "scope": "dart", 49 | "prefix": ["deleteDocument", "deldoc"], 50 | "body": [ 51 | "await database.deleteDocument(databaseId: \"${2:databaseId}\",collectionId: \"${3:collectionId}\", documentId: \"${4:documentId}\");" 52 | ], 53 | "description": "Delete a document by its unique ID. This endpoint deletes only the parent documents, its attributes and relations to other documents. Child documents will not be deleted." 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /snippets/flutter/storage.code-snippets: -------------------------------------------------------------------------------- 1 | { 2 | "Initialize Storage": { 3 | "scope": "dart", 4 | "prefix": ["storage"], 5 | "body": ["final Storage storage = Storage(client);"], 6 | "description": "Create a Storage object and initialize it." 7 | }, 8 | 9 | "Create File": { 10 | "scope": "dart", 11 | "prefix": "createFile", 12 | "body": [ 13 | "final ${1:response} = await storage.createFile(bucketId: \"${2:bucketId}\" ,fileId: \"${3:fileId}\", file: InputFile(path: '${4:./path-to-files/image.jpg}',filename: '${5:filename}');" 14 | ], 15 | "description": "Create a new file. The user who creates the file will automatically be assigned to read and write access unless he has passed custom values for read and write arguments." 16 | }, 17 | 18 | "List Files": { 19 | "scope": "dart", 20 | "prefix": "listFiles", 21 | "body": [ 22 | "final ${1:response} = await storage.listFiles(bucketId: \"${2:bucketId}\" );" 23 | ], 24 | "description": "Get a list of all the user files. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project's files." 25 | }, 26 | 27 | "Get File": { 28 | "scope": "dart", 29 | "prefix": "getFile", 30 | "body": [ 31 | "final ${1:response} = await storage.getFile(bucketId: \"${2:bucketId}\" ,fileId: \"${3:fileId}\");" 32 | ], 33 | "description": "Get a file by its unique ID." 34 | }, 35 | 36 | "Get File Preview": { 37 | "scope": "dart", 38 | "prefix": "getFilePreview", 39 | "body": [ 40 | "final ${1:response} = await storage.getFilePreview(bucketId: \"${2:bucketId}\" ,fileId: \"${3:fileId}\");" 41 | ], 42 | "description": "Get a file preview by its unique ID." 43 | }, 44 | 45 | "Get File for Download": { 46 | "scope": "dart", 47 | "prefix": "getFileForDownload", 48 | "body": [ 49 | "final ${1:response} = await storage.getFileDownload(bucketId: \"${2:bucketId}\" ,fileId: \"${3:fileId}\");" 50 | ], 51 | "description": "Get a file for download by its unique ID." 52 | }, 53 | 54 | "Get File for View": { 55 | "scope": "dart", 56 | "prefix": "getFileForView", 57 | "body": [ 58 | "final ${1:response} = await storage.getFileView(bucketId: \"${2:bucketId}\",fileId: \"${3:fileId}\");" 59 | ], 60 | "description": "Get a file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header." 61 | }, 62 | 63 | "Update File": { 64 | "scope": "dart", 65 | "prefix": "updateFile", 66 | "body": [ 67 | "final ${1:response} = await storage.updateFile(bucketId: \"${2:bucketId}\" ,fileId: \"${3:fileId}\", read: [$4],write:[$5]);" 68 | ], 69 | "description": "Update a file by its unique ID. Only users with write permissions have access to update this resource." 70 | }, 71 | 72 | "Delete File": { 73 | "scope": "dart", 74 | "prefix": "deleteFile", 75 | "body": [ 76 | "await storage.deleteFile(bucketId: \"${2:bucketId}\" ,fileId: \"${3:fileId}\");" 77 | ], 78 | "description": "Delete a file by its unique ID. Only users with write permissions have access to delete this resource." 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /snippets/flutter/teams.code-snippets: -------------------------------------------------------------------------------- 1 | { 2 | "Initialize Team": { 3 | "scope": "dart", 4 | "prefix": ["team"], 5 | "body": ["final Teams teams = Teams(client);"], 6 | "description": "Create a Team object and initialize it." 7 | }, 8 | 9 | "Create Team": { 10 | "scope": "dart", 11 | "prefix": ["createTeam", "crTeam"], 12 | "body": [ 13 | "final ${1:response} = await teams.create(teamId: \"${2:teamId}\" ,name: \"${3:name}\");" 14 | ], 15 | "description": "Create a new Team." 16 | }, 17 | 18 | "List Teams": { 19 | "scope": "dart", 20 | "prefix": ["listTeams", "listTeams"], 21 | "body": ["final ${1:response} = await teams.list();"], 22 | "description": "Get a list of all the user teams. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project's teams." 23 | }, 24 | 25 | "Get Team": { 26 | "scope": "dart", 27 | "prefix": "getTeam", 28 | "body": ["final ${1:response} = await teams.get(teamId: \"${2:teamId}\");"], 29 | "description": "Get a team by its unique ID." 30 | }, 31 | 32 | "Update Team": { 33 | "scope": "dart", 34 | "prefix": ["updateTeam", "upTeam"], 35 | "body": [ 36 | "final ${1:response} = await teams.update(teamId: \"${2:teamId}\", name: \"${3:name}\");" 37 | ], 38 | "description": "Update a team by its unique ID." 39 | }, 40 | 41 | "Delete Team": { 42 | "scope": "dart", 43 | "prefix": ["deleteTeam", "delTeam"], 44 | "body": ["await teams.delete(teamId: \"${2:teamId}\");"], 45 | "description": "Delete a team by its unique ID." 46 | }, 47 | 48 | "Create Team Membership": { 49 | "scope": "dart", 50 | "prefix": ["createTeamMembership", "crTeamMembership"], 51 | "body": [ 52 | "final ${1:response} = await teams.createMembership(teamId: \"${2:teamId}\", email: \"${3:email}\",roles: [$4], url: \"${5:url}\");" 53 | ], 54 | "description": "Create a new Team Membership." 55 | }, 56 | 57 | "Get Team Membership": { 58 | "scope": "dart", 59 | "prefix": ["getTeamMembership", "gtmembership"], 60 | "body": [ 61 | "final ${1:response} = await teams.getMembership(teamId: \"${2:teamId}\");" 62 | ], 63 | "description": "Get a team membership by its unique ID." 64 | }, 65 | 66 | "Update Team Membership Roles": { 67 | "scope": "dart", 68 | "prefix": ["updateTeamMembershiproles"], 69 | "body": [ 70 | "final ${1:response} = await teams.updateMembershipRoles(teamId: \"${2:teamId}\", membershipId: \"${3:membershipId}\",roles: [$4]);" 71 | ], 72 | "description": "Modify the roles of a team member. Only team members with the owner role have access to this endpoint." 73 | }, 74 | 75 | "Update Team Membership status": { 76 | "scope": "dart", 77 | "prefix": ["updateTeamMembershipstatus"], 78 | "body": [ 79 | "final ${1:response} = await teams.updateMembershipStatus(teamId: \"${2:teamId}\", membershipId: \"${3:membershipId}\", userId: \"${4:userId}\", secret: \"${5:secret}\");" 80 | ], 81 | "description": "Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user." 82 | }, 83 | 84 | "Delete Team Membership": { 85 | "scope": "dart", 86 | "prefix": ["deleteTeamMembership", "deleteTeamMembership"], 87 | "body": [ 88 | "await teams.deleteMembership(teamId: \"${2:teamId}\", membershipId: \"${3:membershipId}\");" 89 | ], 90 | "description": "This endpoint allows a user to leave a team or for a team owner to delete the membership of any other team member. You can also use this endpoint to delete a user membership even if it is not accepted." 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /snippets/javascript/client.code-snippets: -------------------------------------------------------------------------------- 1 | { 2 | "Add a Client": { 3 | "scope": "javascript, typescript", 4 | "prefix": "sclient", 5 | "body": [ 6 | "const ${1:client} = new Client();", 7 | "${1:client}", 8 | "\t.setEndpoint('${2:endpoint}')", 9 | "\t.setProject('${3:projectid}')", 10 | "\t.setJWT('${4:jwt}');" 11 | ], 12 | "description": "Create a Client object and initialize it." 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /snippets/kotlin/account.code-snippets: -------------------------------------------------------------------------------- 1 | { 2 | "Initialize account": { 3 | "scope": "kotlin", 4 | "prefix": ["sAccount"], 5 | "body": ["val ${1:account} = Account(${2:client})"], 6 | "description": "Create a Account object and initialize it." 7 | }, 8 | 9 | "Get Account": { 10 | "scope": "kotlin", 11 | "prefix": ["sGetAccount"], 12 | "body": ["val ${1:response} = account.get()"], 13 | "description": "Get currently logged in user data as JSON object." 14 | }, 15 | 16 | "Get Account Preferences": { 17 | "scope": "kotlin", 18 | "prefix": ["sGetAccountPreferences", "sGetAccPrefs"], 19 | "body": ["val ${1:response} = account.getPrefs()"], 20 | "description": "Get currently logged in user preferences as a key-value object." 21 | }, 22 | 23 | "List Account Sessions": { 24 | "scope": "kotlin", 25 | "prefix": ["sGetAccountSession", "sGetAccSession", "sListAccountSessions", "sListAccSessions"], 26 | "body": ["val ${1:response} = account.listSessions()"], 27 | "description": "Get currently logged in user list of active sessions across different devices." 28 | }, 29 | 30 | "List Account Logs": { 31 | "scope": "kotlin", 32 | "prefix": ["sGetAccountLogs", "sGetAccLog", "sListAccountLogs", "sListAccLogs"], 33 | "body": [ 34 | "val ${1:response} = account.listLogs()", 35 | ], 36 | "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." 37 | }, 38 | 39 | "Get Session by ID": { 40 | "scope": "kotlin", 41 | "prefix": ["sGetSessionId", "sGetSessionbyId"], 42 | "body": [ 43 | "val ${1:response} = account.getSession(", 44 | " sessionId = \"${2:sessionId}\"", 45 | ")" 46 | ], 47 | "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." 48 | }, 49 | 50 | "Update Account Name": { 51 | "scope": "kotlin", 52 | "prefix": ["sUpdateName", "sUpName"], 53 | "body": [ 54 | "val ${1:response} = account.updateName(", 55 | " name = \"${2:name}\"", 56 | ")" 57 | ], 58 | "description": "Update currently logged in user account name." 59 | }, 60 | 61 | "Update Account Password": { 62 | "scope": "kotlin", 63 | "prefix": ["sUpdatePassword", "sUpPass"], 64 | "body": [ 65 | "val ${1:response} = account.updatePassword(", 66 | " password = \"${2:password}\"", 67 | ")" 68 | ], 69 | "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." 70 | }, 71 | 72 | "Update Account Email": { 73 | "scope": "kotlin", 74 | "prefix": ["sUpdateEmail", "sUpEmail"], 75 | "body": [ 76 | "val ${1:response} = account.updateEmail(", 77 | " email = \"${2:email@example.com}\",", 78 | " password = \"${3:password}\"", 79 | ")" 80 | ], 81 | "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." 82 | }, 83 | 84 | "Update Account Phone": { 85 | "scope": "kotlin", 86 | "prefix": ["sUpdatePhone", "sUpPhone"], 87 | "body": [ 88 | "val ${1:response} = account.updatePhone(", 89 | " phone = \"${2:phone}\",", 90 | " password = \"${3:password}\"", 91 | ")" 92 | ], 93 | "description": "Update the currently logged in user's phone number. After updating the phone number, the phone verification status will be reset. A confirmation SMS is not sent automatically, however you can use the POST /account/verification/phone endpoint to send a confirmation SMS." 94 | }, 95 | 96 | "Update Account Preferences": { 97 | "scope": "kotlin", 98 | "prefix": ["sUpPrefs", "sUpPref"], 99 | "body": [ 100 | "val ${1:response} = account.updatePrefs(", 101 | " prefs = mapOf( \"${2:a}\" to \"${3:b}\" )", 102 | ")" 103 | ], 104 | "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." 105 | }, 106 | 107 | "Update Account Status": { 108 | "scope": "kotlin", 109 | "prefix": ["sUpdateAccountStatus", "sUpAccStatus"], 110 | "body": ["val ${1:response} = account.updateStatus()" 111 | ], 112 | "description": "Block the currently logged in user account. Behind the scene, the user record is not deleted but permanently blocked from any access. To completely delete a user, use the Users API instead." 113 | }, 114 | 115 | "Delete Account Session": { 116 | "scope": "kotlin", 117 | "prefix": ["sDeleteAccountSession", "sDelAccSession"], 118 | "body": [ 119 | "val ${1:response} = account.deleteSession(", 120 | " sessionId = \"${2:sessionId}\"", 121 | ")" 122 | ], 123 | "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 option id argument, only the session unique ID provider will be deleted." 124 | }, 125 | 126 | "Update Account Session (Refresh Tokens)": { 127 | "scope": "kotlin", 128 | "prefix": ["sUpdateAccountSession", "sUpAccSession"], 129 | "body": [ 130 | "val ${1:response} = account.updateSession(", 131 | " sessionId = \"${2:sessionId}\"", 132 | ")" 133 | ], 134 | "description": "Access tokens have limited lifespan and expire to mitigate security risks. If session was created using an OAuth provider, this route can be used to \"refresh\" the access token." 135 | }, 136 | "Delete All Account Sessions": { 137 | "scope": "kotlin", 138 | "prefix": ["sDeleteAccountSessions", "sDelAccSessions"], 139 | "body": ["val ${1:response} = account.deleteSessions()"], 140 | "description": "Delete all sessions from the user account and remove any sessions cookies from the end client." 141 | }, 142 | 143 | "Create Password Recovery": { 144 | "scope": "kotlin", 145 | "prefix": ["sRecPassword", "sCrRecovery"], 146 | "body": [ 147 | "val ${1:response} = account.createRecovery(", 148 | " email = \"${2:email}\",", 149 | " url = \"${3:url}\"", 150 | ")" 151 | ], 152 | "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 endpoint to complete the process. The verification link sent to the user's email address is valid for 1 hour." 153 | }, 154 | 155 | "Create Password Recovery(confirmation)": { 156 | "scope": "kotlin", 157 | "prefix": ["sUpRecovery", "sUpdateRecovery"], 158 | "body": [ 159 | "val ${1:response} = account.updateRecovery(", 160 | " userId = \"${2:unique()}\",", 161 | " secret = \"${3:secret}\",", 162 | " password = \"${4:password}\",", 163 | " passwordAgain = \"${5:password}\"", 164 | ")" 165 | ], 166 | "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 endpoint to complete the process. The verification link sent to the user's email address is valid for 1 hour." 167 | }, 168 | 169 | "Create Email Verification": { 170 | "scope": "kotlin", 171 | "prefix": ["sEmailVerification", "sCrEmailVerification"], 172 | "body": [ 173 | "val ${1:response} = account.createVerification(", 174 | " url = \"${2:url}\"", 175 | ")" 176 | ], 177 | "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. The verification link sent to the user's email address is valid for 7 days." 178 | }, 179 | 180 | "Create Email Verification (confirmation)": { 181 | "scope": "kotlin", 182 | "prefix": ["sEmailVerificationconfirmation", "sCrEmailVerificationconfirm"], 183 | "body": [ 184 | "val ${1:response} = account.updateVerification(", 185 | " userId = \"${2:unique()}\",", 186 | " secret = \"${3:secret}\"", 187 | ")" 188 | ], 189 | "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." 190 | }, 191 | 192 | "Create Phone Verification": { 193 | "scope": "kotlin", 194 | "prefix": ["sPhoneVerification", "sCrPhoneVerification"], 195 | "body": ["val ${1:response} = account.createPhoneVerification()"], 196 | "description": "Use this endpoint to send a verification SMS to the currently logged in user. This endpoint is meant for use after updating a user's phone number using the accountUpdatePhone endpoint. Learn more about how to complete the verification process. The verification code sent to the user's phone number is valid for 15 minutes." 197 | }, 198 | 199 | "Create Phone Verification(confirmation)": { 200 | "scope": "kotlin", 201 | "prefix": ["sPhoneVerificationconfirmation", "sCrPhoneVerificationconfirm"], 202 | "body": [ 203 | "val ${1:response} = account.updatePhoneVerification(", 204 | " userId = \"${2:unique()}\",", 205 | " secret: \"${3:secret}\"", 206 | ")" 207 | ], 208 | "description": "Use this endpoint to complete the user phone verification process. Use the userId and secret that were sent to your user's phone number to verify the user email ownership. If confirmed this route will return a 200 status code." 209 | } 210 | } 211 | -------------------------------------------------------------------------------- /snippets/kotlin/client.code-snippets: -------------------------------------------------------------------------------- 1 | { 2 | "Add a Kotlin Client": { 3 | "scope": "kotlin", 4 | "prefix": "sclient", 5 | "body": [ 6 | "val ${1:client} = Client(context)", 7 | "\t.setEndpoint(${2:\"https://localhost/v1\"})", 8 | "\t.setProject(${3:\"projectId\"})", 9 | "\t.setJWT(${4:\"jwt\"})" 10 | ], 11 | "description": "Create a Kotlin Client object and initialize it." 12 | } 13 | } -------------------------------------------------------------------------------- /snippets/kotlin/health.code-snippets: -------------------------------------------------------------------------------- 1 | { 2 | "Initialize health": { 3 | "scope": "kotlin", 4 | "prefix": "health", 5 | "body": [ 6 | "val health = Health(client)" 7 | ], 8 | "description": "Create a Health object and initialize it." 9 | }, 10 | 11 | "Get HTTP": { 12 | "scope": "kotlin", 13 | "prefix": ["getHttp", "getHealth"], 14 | "body": [ 15 | "val ${1:response} = health.get()", 16 | "val ${2:json} = ${1:response}.body?.string()" 17 | ], 18 | "description": "Check the Appwrite HTTP server is up and responsive." 19 | }, 20 | 21 | "Get DB": { 22 | "scope": "kotlin", 23 | "prefix": ["getDbHealth", "getDatabaseHealth"], 24 | "body": [ 25 | "val ${1:response} = health.getDB()", 26 | "val ${2:json} = ${1:response}.body?.string()" 27 | ], 28 | "description": "Check the Appwrite database server is up and connection is successful." 29 | }, 30 | 31 | "Get Cache": { 32 | "scope": "kotlin", 33 | "prefix": ["getCacheHealth"], 34 | "body": [ 35 | "val ${1:response} = health.getCache()", 36 | "val ${2:json} = ${1:response}.body?.string()" 37 | ], 38 | "description": "Check the Appwrite in-memory cache server is up and connection is successful." 39 | }, 40 | 41 | "Get Time": { 42 | "scope": "kotlin", 43 | "prefix": ["getTime", "getTimeHealth"], 44 | "body": [ 45 | "val ${1:response} = health.getTime()", 46 | "val ${2:json} = ${1:response}.body?.string()" 47 | ], 48 | "description": "Check the Appwrite server time is synced with Google remote NTP server." 49 | }, 50 | 51 | "Get Webhooks Queue": { 52 | "scope": "kotlin", 53 | "prefix": ["getWebhooksQueue", "getWhQueue", "getQueueWebhooks"], 54 | "body": [ 55 | "val ${1:response} = health.getQueueWebhooks()", 56 | "val ${2:json} = ${1:response}.body?.string()" 57 | ], 58 | "description": "Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server." 59 | }, 60 | 61 | "Get Logs Queue": { 62 | "scope": "kotlin", 63 | "prefix": ["getLogsQueue", "getQueueLogs"], 64 | "body": [ 65 | "val ${1:response} = health.getQueueLogs()", 66 | "val ${2:json} = ${1:response}.body?.string()" 67 | ], 68 | "description": "Get the number of logs that are waiting to be processed in the Appwrite internal queue server." 69 | }, 70 | 71 | "Get Certificates Queue": { 72 | "scope": "kotlin", 73 | "prefix": ["getCertificatesQueue", "getCertsQueue", "getQueueCertificates"], 74 | "body": [ 75 | "val ${1:response} = health.getQueueCertificates()", 76 | "val ${2:json} = ${1:response}.body?.string()" 77 | ], 78 | "description": "Get the number of certificates that are waiting to be issued against Letsencrypt in the Appwrite internal queue server." 79 | }, 80 | 81 | "Get Functions Queue": { 82 | "scope": "kotlin", 83 | "prefix": ["getFuncsQueue", "getFunctionsQueue", "getQueueFunctions"], 84 | "body": [ 85 | "val ${1:response} = health.getQueueFunctions()", 86 | "val ${2:json} = ${1:response}.body?.string()" 87 | ], 88 | "description": "Get the number of function executions that are waiting to be executed." 89 | }, 90 | 91 | "Get Local Storage": { 92 | "scope": "kotlin", 93 | "prefix": ["getStorageHealth", "getStorageLocal"], 94 | "body": [ 95 | "val ${1:response} = health.getStorageLocal()", 96 | "val ${2:json} = ${1:response}.body?.string()" 97 | ], 98 | "description": "Check the Appwrite local storage device is up and connection is successful." 99 | }, 100 | 101 | "Get Antivirus": { 102 | "scope": "kotlin", 103 | "prefix": ["getAntivirusHealth", "getAntivirus"], 104 | "body": [ 105 | "val ${1:response} = health.getAntivirus()", 106 | "val ${2:json} = ${1:response}.body?.string()" 107 | ], 108 | "description": "Check the Appwrite Antivirus server is up and connection is successful." 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /snippets/kotlin/teams.code-snippets: -------------------------------------------------------------------------------- 1 | { 2 | "Initialize Team": { 3 | "scope": "kotlin", 4 | "prefix": ["team"], 5 | "body": ["val teams = Teams(client)"], 6 | "description": "Create a Team object and initialize it." 7 | }, 8 | 9 | "Create Team": { 10 | "scope": "kotlin", 11 | "prefix": ["createTeam", "crTeam"], 12 | "body": [ 13 | "val ${1:response} = teams.create(", 14 | " teamId = \"${2:teamId}\",", 15 | " name: \"${3:name}\"", 16 | ")" 17 | ], 18 | "description": "Create a new Team." 19 | }, 20 | 21 | "List Teams": { 22 | "scope": "kotlin", 23 | "prefix": ["listTeams", "listTeams"], 24 | "body": ["val ${1:response} = teams.list()"], 25 | "description": "Get a list of all the user teams. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project's teams." 26 | }, 27 | 28 | "Get Team": { 29 | "scope": "kotlin", 30 | "prefix": "getTeam", 31 | "body": [ 32 | "val ${1:response} = teams.get(", 33 | " teamId = \"${2:teamId}\"", 34 | ")" 35 | ], 36 | "description": "Get a team by its unique ID." 37 | }, 38 | 39 | "Update Team": { 40 | "scope": "kotlin", 41 | "prefix": ["updateTeam", "upTeam"], 42 | "body": [ 43 | "val ${1:response} = teams.update(", 44 | " teamId = \"${2:teamId}\",", 45 | " name = \"${3:name}\"", 46 | ")" 47 | ], 48 | "description": "Update a team by its unique ID." 49 | }, 50 | 51 | "Delete Team": { 52 | "scope": "kotlin", 53 | "prefix": ["deleteTeam", "delTeam"], 54 | "body": [ 55 | "val ${1:response} = teams.delete(", 56 | " teamId: \"${2:teamId}\"", 57 | ")" 58 | ], 59 | "description": "Delete a team by its unique ID." 60 | }, 61 | 62 | "Create Team Membership": { 63 | "scope": "kotlin", 64 | "prefix": ["createTeamMembership", "crTeamMembership"], 65 | "body": [ 66 | "val ${1:response} = teams.createMembership(", 67 | " teamId = \"${2:teamId}\",", 68 | " email = \"${3:email}\",", 69 | " roles = listof($4),", 70 | " url = \"${5:url}\"", 71 | ")" 72 | ], 73 | "description": "Create a new Team Membership." 74 | }, 75 | 76 | "List Team Memberships": { 77 | "scope": "kotlin", 78 | "prefix": ["listTeamMemberships", "listMemberships"], 79 | "body": [ 80 | "val ${1:response} = teams.listMemberships(", 81 | " teamId = \"${2:teamId}\"", 82 | ")" 83 | ], 84 | "description": "Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint." 85 | }, 86 | 87 | "Get Team Membership": { 88 | "scope": "kotlin", 89 | "prefix": ["getTeamMembership", "gtmembership"], 90 | "body": [ 91 | "val ${1:response} = teams.getMembership(", 92 | " teamId = \"${2:teamId}\"", 93 | ")" 94 | ], 95 | "description": "Get a team membership by its unique ID. All team members have read access for this resource." 96 | }, 97 | 98 | "Update Team Membership Roles": { 99 | "scope": "kotlin", 100 | "prefix": ["updateTeamMembershiproles"], 101 | "body": [ 102 | "val ${1:response} = teams.updateMembershipRoles(", 103 | " teamId = \"${2:teamId}\",", 104 | " membershipId = \"${3:membershipId}\",", 105 | " roles = listOf($4)", 106 | ")" 107 | ], 108 | "description": "Modify the roles of a team member. Only team members with the owner role have access to this endpoint." 109 | }, 110 | 111 | "Update Team Membership status": { 112 | "scope": "kotlin", 113 | "prefix": ["updateTeamMembershipstatus"], 114 | "body": [ 115 | "val ${1:response} = teams.updateMembershipStatus(", 116 | " teamId = \"${2:teamId}\",", 117 | " membershipId = \"${3:membershipId}\",", 118 | " userId = \"${4:userId}\",", 119 | " secret = \"${5:secret}\"", 120 | ")" 121 | ], 122 | "description": "Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user." 123 | }, 124 | 125 | "Delete Team Membership": { 126 | "scope": "kotlin", 127 | "prefix": ["deleteTeamMembership", "deleteTeamMembership"], 128 | "body": [ 129 | "val {1:response} = teams.deleteMembership(", 130 | " teamId = \"${2:teamId}\",", 131 | " membershipId = \"${3:membershipId}\"", 132 | ")" 133 | ], 134 | "description": "This endpoint allows a user to leave a team or for a team owner to delete the membership of any other team member. You can also use this endpoint to delete a user membership even if it is not accepted." 135 | } 136 | } 137 | -------------------------------------------------------------------------------- /snippets/php/health.code-snippets: -------------------------------------------------------------------------------- 1 | { 2 | "Initialize health": { 3 | "scope": "php", 4 | "prefix": "health", 5 | "body": ["\\$${1:health} = new Health(${2:\\$client});"], 6 | "description": "Create a Health object and initialize it." 7 | }, 8 | "Get HTTP": { 9 | "scope": "php", 10 | "prefix": ["getHttp", "getHealth"], 11 | "body": ["\\$${1:response} = \\$health->get();"], 12 | "description": "Check the Appwrite HTTP server is up and responsive." 13 | }, 14 | "Get DB": { 15 | "scope": "php", 16 | "prefix": ["getDbHealth", "getDatabaseHealth"], 17 | "body": ["\\$${1:response} = \\$health->getDB();"], 18 | "description": "Check the Appwrite database server is up and connection is successful." 19 | }, 20 | "Get Cache": { 21 | "scope": "php", 22 | "prefix": ["getCacheHealth"], 23 | "body": ["\\$${1:response} = \\$health->getCache();"], 24 | "description": "Check the Appwrite in-memory cache server is up and connection is successful." 25 | }, 26 | "Get Time": { 27 | "scope": "php", 28 | "prefix": ["getTime", "getTimeHealth"], 29 | "body": ["\\$${1:response} = \\$health->getTime();"], 30 | "description": "Check the Appwrite server time is synced with Google remote NTP server." 31 | }, 32 | "Get Webhooks Queue": { 33 | "scope": "php", 34 | "prefix": ["getWebhooksQueue", "getWhQueue", "getQueueWebhooks"], 35 | "body": ["\\$${1:response} = \\$health->getQueueWebhooks();"], 36 | "description": "Get the number of webhooks that are waiting to be processed in the Appwrite internal queue server." 37 | }, 38 | "Get Logs Queue": { 39 | "scope": "php", 40 | "prefix": ["getLogsQueue", "getQueueLogs"], 41 | "body": ["\\$${1:response} = \\$health->getQueueLogs();"], 42 | "description": "Get the number of logs that are waiting to be processed in the Appwrite internal queue server." 43 | }, 44 | "Get Certificates Queue": { 45 | "scope": "php", 46 | "prefix": ["getCertificatesQueue", "getCertsQueue", "getQueueCertificates"], 47 | "body": ["\\$${1:response} = \\$health->getQueueCertificates();"], 48 | "description": "Get the number of certificates that are waiting to be issued against Letsencrypt in the Appwrite internal queue server." 49 | }, 50 | "Get Functions Queue": { 51 | "scope": "php", 52 | "prefix": ["getFuncsQueue", "getFunctionsQueue", "getQueueFunctions"], 53 | "body": ["\\$${1:response} = \\$health->getQueueFunctions();"], 54 | "description": "Get the number of function executions that are waiting to be executed." 55 | }, 56 | "Get Local Storage": { 57 | "scope": "php", 58 | "prefix": ["getStorageHealth", "getStorageLocal"], 59 | "body": ["\\$${1:response} = \\$health->getStorageLocal();"], 60 | "description": "Check the Appwrite local storage device is up and connection is successful." 61 | }, 62 | "Get Antivirus": { 63 | "scope": "php", 64 | "prefix": ["getAntivirusHealth", "getAntivirus"], 65 | "body": ["\\$${1:response} = \\$health->getAntivirus();"], 66 | "description": "Check the Appwrite Antivirus server is up and connection is successful." 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /snippets/web/account.code-snippets: -------------------------------------------------------------------------------- 1 | { 2 | "Initialize account": { 3 | "scope": "javascript", 4 | "prefix": "account", 5 | "body": ["const ${1:account} = new Account(${2:client});"], 6 | "description": "Create a Account object and initialize it." 7 | }, 8 | "Create account": { 9 | "scope": "javascript", 10 | "prefix": ["crAccount", "createAcount"], 11 | "body": [ 12 | "const ${1:response} = await account.create(\"${2:unique()}\",\"${3:email}\",\"${4:password}\");" 13 | ], 14 | "description": "Allow a new user to register a new account in your project." 15 | }, 16 | 17 | "Create account Session with Email": { 18 | "scope": "javascript", 19 | "prefix": ["crsemail", "createEmailSession"], 20 | "body": [ 21 | "const ${1:response} = await account.createEmailSession(\"${2:email}\", \"${3:password}\");" 22 | ], 23 | "description": "Create a new Account Session" 24 | }, 25 | 26 | "Create account Session with OAuth2": { 27 | "scope": "javascript", 28 | "prefix": ["crsessionOAuth2"], 29 | "body": [ 30 | "const ${1:response} = await account.createOAuth2Session(\"${2:provider}\");" 31 | ], 32 | "description": "Create a new Account Session with OAuth2" 33 | }, 34 | 35 | "Create Magic Url session": { 36 | "scope": "javascript", 37 | "prefix": ["magicUrl", "mgURLSession"], 38 | "body": [ 39 | "const ${1:response} = await account.createMagicURLSession(\"${2:unique()}\", \"${3:email}\");" 40 | ], 41 | "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. " 42 | }, 43 | "Update Magic Url session": { 44 | "scope": "javascript", 45 | "prefix": ["upMagicUrl", "updatemagicUrl", "mgURLSession"], 46 | "body": [ 47 | "const ${1:response} = await account.updateMagicURLSession('${2:unique()}', '${3:secret}');" 48 | ], 49 | "description": "Update Magic URL session" 50 | }, 51 | 52 | "Create Phone session": { 53 | "scope": "javascript", 54 | "prefix": ["crsPhone", "createPhoneSession"], 55 | "body": [ 56 | "const ${1:response} = await account.createPhoneSession('${2:unique()}','${3:number}');" 57 | ], 58 | "description": "Create a new Phone session" 59 | }, 60 | 61 | "Update Phone session": { 62 | "scope": "javascript", 63 | "prefix": ["upPhone", "updatePhoneSession"], 64 | "body": [ 65 | "const ${1:response} = await account.updatePhoneSession('${2:unique()}','${3:number}');" 66 | ], 67 | "description": "Update the Phone session" 68 | }, 69 | 70 | "Create Anonymous session": { 71 | "scope": "javascript", 72 | "prefix": ["crsAccount", "crAnonymous", "createAnonymousSession"], 73 | "body": ["const ${1:response} = await account.createAnonymousSession();"], 74 | "description": "Create a new Anonymous Session" 75 | }, 76 | 77 | "Create JWT": { 78 | "scope": "javascript", 79 | "prefix": ["crJWT", "JWT"], 80 | "body": ["const ${1:response} = await account.createJWT();"], 81 | "description": "Create a new Account using JWT" 82 | }, 83 | 84 | "Get Account": { 85 | "scope": "javascript", 86 | "prefix": ["getAccount"], 87 | "body": ["const ${1:user} = await account.get();"], 88 | "description": "Get currently logged in user data as JSON object." 89 | }, 90 | 91 | "Get Account Preferences": { 92 | "scope": "javascript", 93 | "prefix": ["getAccountPreferences", "getAccPrefs"], 94 | "body": ["const ${1:response} = await account.getPrefs();"], 95 | "description": "Get currently logged in user preferences as a key-value object." 96 | }, 97 | 98 | "Get Account Sessions": { 99 | "scope": "javascript", 100 | "prefix": ["getAccountSession", "getAccSession"], 101 | "body": ["const ${1:response} = await account.getSessions();"], 102 | "description": "Get currently logged in user list of active sessions across different devices." 103 | }, 104 | 105 | "Get Account Logs": { 106 | "scope": "javascript", 107 | "prefix": ["getAccountLogs", "getAccLog"], 108 | "body": ["const ${1:response} = await account.getLogs();"], 109 | "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." 110 | }, 111 | 112 | "Get Session by ID": { 113 | "scope": "javascript", 114 | "prefix": ["getSessionId", "getSessionbyId"], 115 | "body": [ 116 | "const ${1:response} = await account.getSesssion('${2:sessionId}');" 117 | ], 118 | "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." 119 | }, 120 | 121 | "Update Account Name": { 122 | "scope": "javascript", 123 | "prefix": ["updateName", "upName"], 124 | "body": ["const ${1:response} = await account.updateName('${2:name}');"], 125 | "description": "Update currently logged in user account name." 126 | }, 127 | 128 | "Update Account Password": { 129 | "scope": "javascript", 130 | "prefix": ["updatePassword", "upPass"], 131 | "body": [ 132 | "const ${1:response} = await account.updatePassword('${2:password}');" 133 | ], 134 | "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." 135 | }, 136 | 137 | "Update Account Email": { 138 | "scope": "javascript", 139 | "prefix": ["updateEmail", "upEmail"], 140 | "body": [ 141 | "const ${1:response} = await account.updateEmail('$2{email}','${3:password}');" 142 | ], 143 | "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. " 144 | }, 145 | 146 | "Update Account Preferences": { 147 | "scope": "javascript", 148 | "prefix": ["upPrefs", "upPref"], 149 | "body": ["const ${1:response} = await account.updatePrefs({$2});"], 150 | "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." 151 | }, 152 | 153 | "Delete Account": { 154 | "scope": "javascript", 155 | "prefix": ["deleteAccount", "delAcc"], 156 | "body": ["await account.delete();"], 157 | "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." 158 | }, 159 | 160 | "Delete Account Session": { 161 | "scope": "javascript", 162 | "prefix": ["deleteAccountSession", "delAccSession"], 163 | "body": ["await account.deleteSession('${1:sessionId}');"], 164 | "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 option id argument, only the session unique ID provider will be deleted." 165 | }, 166 | 167 | "Delete All Account Sessions": { 168 | "scope": "javascript", 169 | "prefix": ["deleteAccountSessions", "delAccSessions"], 170 | "body": ["await account.deleteSessions();"], 171 | "description": "Delete all sessions from the user account and remove any sessions cookies from the end client." 172 | }, 173 | 174 | "Create Password Recovery": { 175 | "scope": "javascript", 176 | "prefix": ["recPassword", "crRecovery"], 177 | "body": [ 178 | "const ${1:response} = await account.createRecovery('${2:email}','${3:url}');" 179 | ], 180 | "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 endpoint to complete the process. The verification link sent to the user's email address is valid for 1 hour." 181 | }, 182 | 183 | "Create Password Recovery(confirmation)": { 184 | "scope": "javascript", 185 | "prefix": ["upRecovery", "updateRecovery"], 186 | "body": [ 187 | "const ${1:response} = await account.updateRecovery('${2:userId}', '${3:secret}','${4:password}','${5:password}');" 188 | ], 189 | "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 endpoint to complete the process. The verification link sent to the user's email address is valid for 1 hour." 190 | }, 191 | 192 | "Create Email Verification": { 193 | "scope": "javascript", 194 | "prefix": ["emailVerification", "crEmailVerification"], 195 | "body": [ 196 | "const ${1:response} = await account.createVerification('${2:url}');" 197 | ], 198 | "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. The verification link sent to the user's email address is valid for 7 days." 199 | }, 200 | 201 | "Create Email Verification(confirmation)": { 202 | "scope": "javascript", 203 | "prefix": ["emailVerificationconfirmation", "crEmailVerificationconfirm"], 204 | "body": [ 205 | "const ${1:response} = await account.updateVerification('${2:userId}','${3:secret}');" 206 | ], 207 | "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." 208 | }, 209 | 210 | "Create Phone Verification": { 211 | "scope": "javascript", 212 | "prefix": ["phoneVerification", "crPhoneVerification"], 213 | "body": ["const ${1:response} = await account.createPhoneVerification();"], 214 | "description": "Use this endpoint to send a verification SMS to the currently logged in user. This endpoint is meant for use after updating a user's phone number using the accountUpdatePhone endpoint. Learn more about how to complete the verification process. The verification code sent to the user's phone number is valid for 15 minutes." 215 | }, 216 | 217 | "Create Phone Verification(confirmation)": { 218 | "scope": "javascript", 219 | "prefix": ["phoneVerificationconfirmation", "crPhoneVerificationconfirm"], 220 | "body": [ 221 | "const ${1:response} = await account.updatePhoneVerification('${2:userId}','${3:secret}');" 222 | ], 223 | "description": "Use this endpoint to complete the user phone verification process. Use the userId and secret that were sent to your user's phone number to verify the user email ownership. If confirmed this route will return a 200 status code." 224 | } 225 | } 226 | -------------------------------------------------------------------------------- /snippets/web/client.code-snippets: -------------------------------------------------------------------------------- 1 | { 2 | "Add a Client": { 3 | "scope": "javascript", 4 | "prefix": "client", 5 | "body": [ 6 | "const ${1:client} = new Client();", 7 | "${1:client}", 8 | "\t.setEndpoint('${2:endpoint}')", 9 | "\t.setProject('${3:projectid}')" 10 | ], 11 | "description": "Create a Client object and initialize it." 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /snippets/web/database.code-snippets: -------------------------------------------------------------------------------- 1 | { 2 | "Initialize Database": { 3 | "scope": "javascript", 4 | "prefix": ["database"], 5 | "body": ["const database = Database(client,\"${1:databaseId}\" );"], 6 | "description": "Create a Database object and initialize it." 7 | }, 8 | 9 | "Create Document": { 10 | "scope": "javascript", 11 | "prefix": ["crdoc", "crDocument"], 12 | "body": [ 13 | "const ${1:response} = await database.createDocument(\"${2:collectionId}\", \"${3:documentId}\", {\"${4:data}\"});" 14 | ], 15 | "description": "Create a new Document. Before using this route, you should create a new collection resource using either a server integration API or directly from your database console." 16 | }, 17 | 18 | "List Document": { 19 | "scope": "javascript", 20 | "prefix": ["lsdoc", "lsd"], 21 | "body": [ 22 | "const ${1:response} = await database.listDocuments(\"${2:collectionId}\",);" 23 | ], 24 | "description": "Get a list of all the user documents. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project's documents." 25 | }, 26 | 27 | "Get Document": { 28 | "scope": "javascript", 29 | "prefix": "getDocument", 30 | "body": [ 31 | "const ${1:response} = await database.getDocument(\"${2:collectionId}\", \"${3:documentId}\");" 32 | ], 33 | "description": "Get a document by its unique ID. This endpoint response returns a JSON object with the document data." 34 | }, 35 | 36 | "Update Document": { 37 | "scope": "javascript", 38 | "prefix": ["updateDocument"], 39 | "body": [ 40 | "const ${1:response} = await database.updateDocument( \"${2:collectionId}\", \"${3:documentId}\", {$4});" 41 | ], 42 | "description": "Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated." 43 | }, 44 | 45 | "Delete Document": { 46 | "scope": "javascript", 47 | "prefix": ["deleteDocument", "deldoc"], 48 | "body": [ 49 | "await database.deleteDocument( \"${2:collectionId}\", \"${3:documentId}\");" 50 | ], 51 | "description": "Delete a document by its unique ID. This endpoint deletes only the parent documents, its attributes and relations to other documents. Child documents will not be deleted." 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /snippets/web/functions-code.snippets.code-snippets: -------------------------------------------------------------------------------- 1 | { 2 | "Create Function" :{ 3 | "scope": "javascript , typescript", 4 | "prefix": "createfunc", 5 | "body": ["const ${1:function} = new Function(${2:client})"] , 6 | "description": "Create a new Function object and initialize it" 7 | }, 8 | "Create Execution": { 9 | "scope" : "javascript , typescript" , 10 | "prefix" : "execfunc", 11 | "body" : ["const ${1:response} = await ${2:function}.createExecution(`${3:[FUNCTION_ID]}`)"] , 12 | "description": "Trigger a function execution. The returned object will return you the current execution status. " 13 | }, 14 | "List Execution": { 15 | "scope" : "javascript , typescript" , 16 | "prefix": "listfunc" , 17 | "body": ["const ${1:response} = await ${2:function}.listExecution(`${3:[FUNCTION_ID]}`)"] , 18 | "description": "Get a list of all the current user function execution logs." 19 | }, 20 | "Get Execution" : { 21 | "scope" : "javascript , typescript" , 22 | "prefix": "getfunc" , 23 | "body": ["const ${1:response} = await ${2:function}.getExecution(`${3:[FUNCTION_ID]}` , `${4:[EXECUTION_ID]}`)"] , 24 | "description": "Get a function execution log by its unique ID." 25 | } 26 | } 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /snippets/web/storage.code-snippets: -------------------------------------------------------------------------------- 1 | { 2 | "Initialize Storage": { 3 | "scope": "javascript", 4 | "prefix": ["storage"], 5 | "body": ["const storage = Storage(client);"], 6 | "description": "Create a Storage object and initialize it." 7 | }, 8 | 9 | "Create File": { 10 | "scope": "javascript", 11 | "prefix": "createFile", 12 | "body": [ 13 | "const ${1:response} = await storage.createFile(\"${2:bucketId}\" ,\"${3:fileId}\",${4:document.getElementById('uploader').files[0]} );" 14 | ], 15 | "description": "Create a new file. The user who creates the file will automatically be assigned to read and write access unless he has passed custom values for read and write arguments." 16 | }, 17 | 18 | "List Files": { 19 | "scope": "javascript", 20 | "prefix": "listFiles", 21 | "body": [ 22 | "const ${1:response} = await storage.listFiles(\"${2:bucketId}\" );" 23 | ], 24 | "description": "Get a list of all the user files. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project's files." 25 | }, 26 | 27 | "Get File": { 28 | "scope": "javascript", 29 | "prefix": "getFile", 30 | "body": [ 31 | "const ${1:response} = await storage.getFile(\"${2:bucketId}\" ,\"${3:fileId}\");" 32 | ], 33 | "description": "Get a file by its unique ID." 34 | }, 35 | 36 | "Get File Preview": { 37 | "scope": "javascript", 38 | "prefix": "getFilePreview", 39 | "body": [ 40 | "const ${1:response} = await storage.getFilePreview(\"${2:bucketId}\" ,\"${3:fileId}\");" 41 | ], 42 | "description": "Get a file preview by its unique ID." 43 | }, 44 | 45 | "Get File for Download": { 46 | "scope": "javascript", 47 | "prefix": "getFileForDownload", 48 | "body": [ 49 | "const ${1:response} = await storage.getFileDownload(\"${2:bucketId}\" ,\"${3:fileId}\");" 50 | ], 51 | "description": "Get a file for download by its unique ID." 52 | }, 53 | 54 | "Get File for View": { 55 | "scope": "javascript", 56 | "prefix": "getFileForView", 57 | "body": [ 58 | "const ${1:response} = await storage.getFileView(\"${2:bucketId}\",\"${3:fileId}\");" 59 | ], 60 | "description": "Get a file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header." 61 | }, 62 | 63 | "Update File": { 64 | "scope": "javascript", 65 | "prefix": "updateFile", 66 | "body": [ 67 | "const ${1:response} = await storage.updateFile(\"${2:bucketId}\" ,\"${3:fileId}\", [\"${4:read}\"],[\"${5:write}\"]);" 68 | ], 69 | "description": "Update a file by its unique ID. Only users with write permissions have access to update this resource." 70 | }, 71 | 72 | "Delete File": { 73 | "scope": "javascript", 74 | "prefix": "deleteFile", 75 | "body": ["await storage.deleteFile(\"${2:bucketId}\" ,\"${3:fileId}\");"], 76 | "description": "Delete a file by its unique ID. Only users with write permissions have access to delete this resource." 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /snippets/web/teams.code-snippets: -------------------------------------------------------------------------------- 1 | { 2 | "Initialize Team": { 3 | "scope": "javascript", 4 | "prefix": ["team"], 5 | "body": ["const team = Team(client);"], 6 | "description": "Create a Team object and initialize it." 7 | }, 8 | 9 | "Create Team": { 10 | "scope": "javascript", 11 | "prefix": ["createTeam", "crTeam"], 12 | "body": [ 13 | "const ${1:response} = await team.create(\"${2:teamId}\",\"${3:name}\");" 14 | ], 15 | "description": "Create a new Team." 16 | }, 17 | 18 | "List Teams": { 19 | "scope": "javascript", 20 | "prefix": ["listTeams", "listTeams"], 21 | "body": ["const ${1:response} = await team.list();"], 22 | "description": "Get a list of all the user teams. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project's teams." 23 | }, 24 | 25 | "Get Team": { 26 | "scope": "javascript", 27 | "prefix": "getTeam", 28 | "body": ["const ${1:response} = await team.get(\"${2:teamId}\");"], 29 | "description": "Get a team by its unique ID." 30 | }, 31 | 32 | "Update Team": { 33 | "scope": "javascript", 34 | "prefix": ["updateTeam", "upTeam"], 35 | "body": [ 36 | "const ${1:response} = await team.update(\"${2:teamId}\",\"${3:name}\");" 37 | ], 38 | "description": "Update a team by its unique ID." 39 | }, 40 | 41 | "Delete Team": { 42 | "scope": "javascript", 43 | "prefix": ["deleteTeam", "delTeam"], 44 | "body": ["await team.delete(\"${2:teamId}\");"], 45 | "description": "Delete a team by its unique ID." 46 | }, 47 | 48 | "Create Team Membership": { 49 | "scope": "javascript", 50 | "prefix": ["createTeamMembership", "crTeamMembership"], 51 | "body": [ 52 | "const ${1:response} = await team.createMembership(\"${2:teamId}\",\"${3:email}\",[$4],\"${5:url}\");" 53 | ], 54 | "description": "Create a new Team Membership." 55 | }, 56 | 57 | "Get Team Membership": { 58 | "scope": "javascript", 59 | "prefix": ["getTeamMembership", "gtmembership"], 60 | "body": [ 61 | "const ${1:response} = await team.getMembership(\"${2:teamId}\");" 62 | ], 63 | "description": "Get a team membership by its unique ID." 64 | }, 65 | 66 | "Update Team Membership Roles": { 67 | "scope": "javascript", 68 | "prefix": ["updateTeamMembershiproles"], 69 | "body": [ 70 | "const ${1:response} = await team.updateMembershipRoles(\"${2:teamId}\",\"${3:membershipId}\",[$4]);" 71 | ], 72 | "description": "Modify the roles of a team member. Only team members with the owner role have access to this endpoint." 73 | }, 74 | 75 | "Update Team Membership status": { 76 | "scope": "javascript", 77 | "prefix": ["updateTeamMembershipstatus"], 78 | "body": [ 79 | "const ${1:response} = await team.updateMembershipStatus(\"${2:teamId}\",\"${3:membershipId}\",\"${4:userId}\",\"${5:secret}\");" 80 | ], 81 | "description": "Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user." 82 | }, 83 | 84 | "Delete Team Membership": { 85 | "scope": "javascript", 86 | "prefix": ["deleteTeamMembership", "delTeamMembership"], 87 | "body": [ 88 | "await team.deleteMembership(\"${2:teamId}\",\"${3:membershipId}\");" 89 | ], 90 | "description": "This endpoint allows a user to leave a team or for a team owner to delete the membership of any other team member. You can also use this endpoint to delete a user membership even if it is not accepted." 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /vsc-extension-quickstart.md: -------------------------------------------------------------------------------- 1 | # Welcome to your VS Code Extension 2 | 3 | ## What's in the folder 4 | 5 | * This folder contains all of the files necessary for your extension. 6 | * `package.json` - this is the manifest file that defines the location of the snippet file and specifies the language of the snippets. 7 | * `snippets/snippets.json` - the file containing all snippets. 8 | 9 | ## Get up and running straight away 10 | 11 | * Press `F5` to open a new window with your extension loaded. 12 | * Create a new file with a file name suffix matching your language. 13 | * Verify that your snippets are proposed on intellisense. 14 | 15 | ## Make changes 16 | 17 | * You can relaunch the extension from the debug toolbar after making changes to the files listed above. 18 | * You can also reload (`Ctrl+R` or `Cmd+R` on Mac) the VS Code window with your extension to load your changes. 19 | 20 | ## Install your extension 21 | 22 | * To start using your extension with Visual Studio Code copy it into the `/.vscode/extensions` folder and restart Code. 23 | * To share your extension with the world, read on https://code.visualstudio.com/docs about publishing an extension. 24 | --------------------------------------------------------------------------------