├── .editorconfig ├── .eslintrc.js ├── .github ├── ISSUE_TEMPLATE │ ├── bug.yaml │ ├── documentation.yaml │ └── feature.yaml └── workflows │ └── autoclose.yml ├── .gitignore ├── .npmignore ├── .prettierrc ├── .travis.yml ├── COMPONENT_INDEX.md ├── LICENSE ├── README.md ├── demo ├── .gitignore ├── README.md ├── package.json ├── public │ ├── favicon.png │ ├── global.css │ └── index.html ├── rollup.config.js ├── src │ ├── App.svelte │ ├── Gallery.svelte │ ├── Login.svelte │ ├── TodoList.svelte │ └── main.js └── yarn.lock ├── package-lock.json ├── package.json ├── src ├── Account │ ├── Create.svelte │ ├── Delete.svelte │ ├── Preferences.svelte │ ├── RecoverPassword.svelte │ ├── Update.svelte │ ├── User.svelte │ └── Verification.svelte ├── Auth │ ├── Email.svelte │ └── OAuth2.svelte ├── Avatars │ ├── Browser.svelte │ ├── CreditCard.svelte │ ├── Favicon.svelte │ ├── Flag.svelte │ ├── Image.svelte │ └── QR.svelte ├── Database │ ├── Collection.svelte │ └── Document.svelte ├── Functions │ └── Function.svelte ├── Init.svelte ├── Locale │ ├── Continents.svelte │ ├── Countries.svelte │ ├── Currencies.svelte │ ├── Languages.svelte │ ├── Locale.svelte │ └── PhoneCodes.svelte ├── Storage │ ├── File.svelte │ ├── FileList.svelte │ └── Storage.svelte ├── appwrite.js ├── index.js ├── keys.js ├── stores.js └── stores │ ├── documents.js │ └── user.js └── types ├── Account ├── Create.d.ts ├── Delete.d.ts ├── Preferences.d.ts ├── RecoverPassword.d.ts ├── Update.d.ts ├── User.d.ts └── Verification.d.ts ├── Auth ├── Email.d.ts └── OAuth2.d.ts ├── Avatars ├── Browser.d.ts ├── CreditCard.d.ts ├── Favicon.d.ts ├── Flag.d.ts ├── Image.d.ts └── QR.d.ts ├── Database ├── Collection.d.ts └── Document.d.ts ├── Functions └── Function.d.ts ├── Init.d.ts ├── Locale ├── Continents.d.ts ├── Countries.d.ts ├── Languages.d.ts └── Locale.d.ts ├── Storage ├── File.d.ts ├── FileList.d.ts └── Storage.d.ts └── index.d.ts /.editorconfig: -------------------------------------------------------------------------------- 1 | [*] 2 | indent_style = space 3 | indent_size = 2 -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | env: { 3 | browser: true, 4 | amd: true, 5 | node: true, 6 | es6: true, 7 | }, 8 | plugins: ["svelte3"], 9 | overrides: [ 10 | { 11 | files: ["**/*.svelte"], 12 | processor: "svelte3/svelte3", 13 | }, 14 | ], 15 | extends: "eslint:recommended", 16 | globals: { 17 | Atomics: "readonly", 18 | SharedArrayBuffer: "readonly", 19 | }, 20 | parserOptions: { 21 | ecmaVersion: 2020, 22 | sourceType: "module", 23 | }, 24 | settings: { 25 | "svelte3/ignore-styles": () => true, 26 | }, 27 | }; 28 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/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 0.10.x 41 | - Version 0.9.x 42 | - Version 0.8.x 43 | - Version 0.7.x 44 | - Version 0.6.x 45 | - Different version (specify in environment) 46 | validations: 47 | required: true 48 | - type: dropdown 49 | id: operating-system 50 | attributes: 51 | label: "💻 Operating system" 52 | description: "What OS is your server / device running on?" 53 | options: 54 | - Linux 55 | - MacOS 56 | - Windows 57 | - Something else 58 | validations: 59 | required: true 60 | - type: textarea 61 | id: enviromnemt 62 | validations: 63 | required: false 64 | attributes: 65 | label: "🧱 Your Environment" 66 | description: "Is your environment customized in any way?" 67 | placeholder: "I use Cloudflare for ..." 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/appwrite/appwrite/blob/HEAD/CODE_OF_CONDUCT.md)" 82 | required: true 83 | -------------------------------------------------------------------------------- /.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/appwrite/appwrite/blob/HEAD/CODE_OF_CONDUCT.md)" 32 | required: true -------------------------------------------------------------------------------- /.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/appwrite/appwrite/blob/HEAD/CODE_OF_CONDUCT.md)" 40 | required: true -------------------------------------------------------------------------------- /.github/workflows/autoclose.yml: -------------------------------------------------------------------------------- 1 | name: Auto-close External Pull Requests 2 | 3 | on: 4 | pull_request_target: 5 | types: [opened, reopened] 6 | 7 | jobs: 8 | auto_close: 9 | uses: appwrite/.github/.github/workflows/autoclose.yml@main 10 | secrets: 11 | GH_AUTO_CLOSE_PR_TOKEN: ${{ secrets.GH_AUTO_CLOSE_PR_TOKEN }} 12 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist/ 4 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | demo/ -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "arrowParens": "avoid", 3 | "semi": true, 4 | "tabWidth": 2, 5 | "svelteSortOrder" : "options-scripts-markup-styles", 6 | "svelteStrictMode": false, 7 | "svelteBracketNewLine": false, 8 | "svelteAllowShorthand": true 9 | } -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "14.16" 4 | 5 | jobs: 6 | include: 7 | - stage: npm release 8 | node_js: "14.16" 9 | script: echo "Deploying to npm ..." 10 | deploy: 11 | provider: npm 12 | email: $NPM_EMAIL 13 | api_key: $NPM_API_KEY 14 | on: 15 | tags: true 16 | -------------------------------------------------------------------------------- /COMPONENT_INDEX.md: -------------------------------------------------------------------------------- 1 | # Component Index 2 | 3 | ## Components 4 | 5 | - [`Appwrite`](#appwrite) 6 | - [`AuthEmail`](#authemail) 7 | - [`AuthOAuth2`](#authoauth2) 8 | - [`Browser`](#browser) 9 | - [`Collection`](#collection) 10 | - [`Continents`](#continents) 11 | - [`Countries`](#countries) 12 | - [`Create`](#create) 13 | - [`CreditCard`](#creditcard) 14 | - [`Delete`](#delete) 15 | - [`Document`](#document) 16 | - [`Favicon`](#favicon) 17 | - [`File`](#file) 18 | - [`FileList`](#filelist) 19 | - [`Flag`](#flag) 20 | - [`Function`](#function) 21 | - [`Image`](#image) 22 | - [`Languages`](#languages) 23 | - [`Locale`](#locale) 24 | - [`Preferences`](#preferences) 25 | - [`QR`](#qr) 26 | - [`RecoverPassword`](#recoverpassword) 27 | - [`Storage`](#storage) 28 | - [`Update`](#update) 29 | - [`User`](#user) 30 | - [`Verification`](#verification) 31 | 32 | --- 33 | 34 | ## `Appwrite` 35 | 36 | ### Props 37 | 38 | | Prop name | Kind | Reactive | Type | Default value | Description | 39 | | :-------- | :--------------- | :------- | :------------------ | ----------------- | ----------- | 40 | | endpoint | let | No | string | -- | -- | 41 | | project | let | No | string | -- | -- | 42 | | locale | let | No | string | "en" | -- | 43 | 44 | ### Slots 45 | 46 | | Slot name | Default | Props | Fallback | 47 | | :-------- | :------ | :---- | :------- | 48 | | -- | Yes | -- | -- | 49 | 50 | ### Events 51 | 52 | None. 53 | 54 | ## `AuthEmail` 55 | 56 | ### Props 57 | 58 | None. 59 | 60 | ### Slots 61 | 62 | | Slot name | Default | Props | Fallback | 63 | | :-------- | :------ | :--------------------------------------------------------------------------------- | :------- | 64 | | -- | Yes | { authorize: (email: string, password: string) => Promise; } | -- | 65 | | error | No | { error: object } | -- | 66 | | loading | No | -- | -- | 67 | | success | No | { user: any } | -- | 68 | 69 | ### Events 70 | 71 | | Event name | Type | Detail | 72 | | :--------- | :--------- | :----- | 73 | | success | dispatched | -- | 74 | | failure | dispatched | -- | 75 | 76 | ## `AuthOAuth2` 77 | 78 | ### Props 79 | 80 | | Prop name | Kind | Reactive | Type | Default value | Description | 81 | | :-------- | :--------------- | :------- | :--- | ------------- | ----------- | 82 | | provider | let | No | -- | -- | -- | 83 | | success | let | No | -- | -- | -- | 84 | | failure | let | No | -- | -- | -- | 85 | 86 | ### Slots 87 | 88 | | Slot name | Default | Props | Fallback | 89 | | :-------- | :------ | :---------------------------------------------------------------------------------------------------- | :------- | 90 | | -- | Yes | { authorize: (provider: string, success: string, failure: string) => Promise; } | -- | 91 | 92 | ### Events 93 | 94 | None. 95 | 96 | ## `Browser` 97 | 98 | ### Props 99 | 100 | | Prop name | Kind | Reactive | Type | Default value | Description | 101 | | :-------- | :--------------- | :------- | :------------------ | ---------------- | ----------- | 102 | | code | let | No | -- | -- | -- | 103 | | width | let | No | number | 100 | -- | 104 | | height | let | No | number | 100 | -- | 105 | | quality | let | No | number | 100 | -- | 106 | 107 | ### Slots 108 | 109 | | Slot name | Default | Props | Fallback | 110 | | :-------- | :------ | :------------------------- | :------- | 111 | | -- | Yes | { src: any } | -- | 112 | 113 | ### Events 114 | 115 | None. 116 | 117 | ## `Collection` 118 | 119 | ### Props 120 | 121 | | Prop name | Kind | Reactive | Type | Default value | Description | 122 | | :--------- | :--------------- | :------- | :-------------------- | --------------------- | ----------- | 123 | | id | let | No | string | -- | -- | 124 | | filters | let | No | string[] | [] | -- | 125 | | offset | let | No | number | 0 | -- | 126 | | limit | let | No | number | 25 | -- | 127 | | orderField | let | No | string | "" | -- | 128 | | orderType | let | No | string | "" | -- | 129 | | orderCast | let | No | string | "string" | -- | 130 | | search | let | No | string | "" | -- | 131 | | cache | let | No | boolean | false | -- | 132 | 133 | ### Slots 134 | 135 | | Slot name | Default | Props | Fallback | 136 | | :-------- | :------ | :--------------------------------------------------------------------------------------------------------------------------------------------------------- | :------- | 137 | | -- | Yes | { documents: any[]; actions: { reload: () => Promise; create: (data: any, read?: string[], write?: string[]) => Promise; } } | -- | 138 | | error | No | { error: object } | -- | 139 | | loading | No | -- | -- | 140 | 141 | ### Events 142 | 143 | None. 144 | 145 | ## `Continents` 146 | 147 | ### Props 148 | 149 | None. 150 | 151 | ### Slots 152 | 153 | | Slot name | Default | Props | Fallback | 154 | | :-------- | :------ | :---------------------------------------------------------------------------- | :------- | 155 | | -- | Yes | { continents: any; actions: { reload: () => Promise; }} | -- | 156 | | error | No | { error: object } | -- | 157 | | loading | No | -- | -- | 158 | 159 | ### Events 160 | 161 | None. 162 | 163 | ## `Countries` 164 | 165 | ### Props 166 | 167 | | Prop name | Kind | Reactive | Type | Default value | Description | 168 | | :-------- | :--------------- | :------- | :------------------- | ------------------ | ----------- | 169 | | eu | let | No | boolean | false | -- | 170 | 171 | ### Slots 172 | 173 | | Slot name | Default | Props | Fallback | 174 | | :-------- | :------ | :--------------------------------------------------------------------------- | :------- | 175 | | -- | Yes | { countries: any; actions: { reload: () => Promise; }} | -- | 176 | | error | No | { error: object } | -- | 177 | | loading | No | -- | -- | 178 | 179 | ### Events 180 | 181 | None. 182 | 183 | ## `Create` 184 | 185 | ### Props 186 | 187 | None. 188 | 189 | ### Slots 190 | 191 | | Slot name | Default | Props | Fallback | 192 | | :-------- | :------ | :---------------------------------------------------------------------------------------------------------- | :------- | 193 | | -- | Yes | { actions: { create: (email: string, password: string, name?: string) => Promise; } } | -- | 194 | 195 | ### Events 196 | 197 | | Event name | Type | Detail | 198 | | :--------- | :--------- | :----- | 199 | | success | dispatched | -- | 200 | | failure | dispatched | -- | 201 | 202 | ## `CreditCard` 203 | 204 | ### Props 205 | 206 | | Prop name | Kind | Reactive | Type | Default value | Description | 207 | | :-------- | :--------------- | :------- | :------------------ | ---------------- | ----------- | 208 | | code | let | No | -- | -- | -- | 209 | | width | let | No | number | 100 | -- | 210 | | height | let | No | number | 100 | -- | 211 | | quality | let | No | number | 100 | -- | 212 | 213 | ### Slots 214 | 215 | | Slot name | Default | Props | Fallback | 216 | | :-------- | :------ | :------------------------- | :------- | 217 | | -- | Yes | { src: any } | -- | 218 | 219 | ### Events 220 | 221 | None. 222 | 223 | ## `Delete` 224 | 225 | ### Props 226 | 227 | None. 228 | 229 | ### Slots 230 | 231 | | Slot name | Default | Props | Fallback | 232 | | :-------- | :------ | :------------------------------------------------------------ | :------- | 233 | | -- | Yes | { actions: { delete: () => Promise; } } | -- | 234 | 235 | ### Events 236 | 237 | None. 238 | 239 | ## `Document` 240 | 241 | ### Props 242 | 243 | | Prop name | Kind | Reactive | Type | Default value | Description | 244 | | :--------- | :--------------- | :------- | :------------------- | ------------- | ----------- | 245 | | document | let | Yes | any | -- | -- | 246 | | collection | let | Yes | string | -- | -- | 247 | | id | let | Yes | string | -- | -- | 248 | | cache | let | No | boolean | -- | -- | 249 | 250 | ### Slots 251 | 252 | | Slot name | Default | Props | Fallback | 253 | | :-------- | :------ | :-------------------------------------------------------------------------------------------------------------------------------------------------- | :------- | 254 | | -- | Yes | { document: any; actions: { reload: () => Promise; update: (data: any) => Promise; remove: () => Promise; } } | -- | 255 | | error | No | { error: any } | -- | 256 | | loading | No | -- | -- | 257 | 258 | ### Events 259 | 260 | | Event name | Type | Detail | 261 | | :--------- | :--------- | :----- | 262 | | change | dispatched | -- | 263 | 264 | ## `Favicon` 265 | 266 | ### Props 267 | 268 | | Prop name | Kind | Reactive | Type | Default value | Description | 269 | | :-------- | :--------------- | :------- | :--- | ------------- | ----------- | 270 | | url | let | No | -- | -- | -- | 271 | 272 | ### Slots 273 | 274 | | Slot name | Default | Props | Fallback | 275 | | :-------- | :------ | :------------------------- | :------- | 276 | | -- | Yes | { src: any } | -- | 277 | 278 | ### Events 279 | 280 | None. 281 | 282 | ## `File` 283 | 284 | ### Props 285 | 286 | | Prop name | Kind | Reactive | Type | Default value | Description | 287 | | :-------- | :--------------- | :------- | :--- | ------------- | ----------- | 288 | | file | let | No | -- | -- | -- | 289 | 290 | ### Slots 291 | 292 | | Slot name | Default | Props | Fallback | 293 | | :-------- | :------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------- | 294 | | -- | Yes | { file: any; actions: { download: () => string; view: (as?: string) => string; preview: (width?: string, height?: string, quality?: string, background?: string, output?: string) => string; update: (read?: any, write?: any) => Promise; delete: () => Promise; }} | -- | 295 | | error | No | { error: object } | -- | 296 | 297 | ### Events 298 | 299 | None. 300 | 301 | ## `FileList` 302 | 303 | ### Props 304 | 305 | | Prop name | Kind | Reactive | Type | Default value | Description | 306 | | :-------- | :--------------- | :------- | :------------------ | ------------------ | ----------- | 307 | | search | let | No | string | "" | -- | 308 | | limit | let | No | number | 25 | -- | 309 | | offset | let | No | number | 0 | -- | 310 | | orderType | let | No | string | "ASC" | -- | 311 | 312 | ### Slots 313 | 314 | | Slot name | Default | Props | Fallback | 315 | | :-------- | :------ | :------------------------------------------------------------------------- | :------- | 316 | | -- | Yes | { files: any[]; actions: { reload: () => Promise; }} | -- | 317 | | error | No | { error: object } | -- | 318 | | loading | No | -- | -- | 319 | 320 | ### Events 321 | 322 | None. 323 | 324 | ## `Flag` 325 | 326 | ### Props 327 | 328 | | Prop name | Kind | Reactive | Type | Default value | Description | 329 | | :-------- | :--------------- | :------- | :------------------ | ---------------- | ----------- | 330 | | code | let | No | -- | -- | -- | 331 | | width | let | No | number | 100 | -- | 332 | | height | let | No | number | 100 | -- | 333 | | quality | let | No | number | 100 | -- | 334 | 335 | ### Slots 336 | 337 | | Slot name | Default | Props | Fallback | 338 | | :-------- | :------ | :------------------------- | :------- | 339 | | -- | Yes | { src: any } | -- | 340 | 341 | ### Events 342 | 343 | None. 344 | 345 | ## `Function` 346 | 347 | ### Props 348 | 349 | | Prop name | Kind | Reactive | Type | Default value | Description | 350 | | :-------- | :--------------- | :------- | :------------------ | --------------- | ----------- | 351 | | id | let | No | -- | -- | -- | 352 | | search | let | No | string | "" | -- | 353 | | limit | let | No | number | 25 | -- | 354 | | offset | let | No | number | 0 | -- | 355 | | orderType | let | No | string | "" | -- | 356 | 357 | ### Slots 358 | 359 | | Slot name | Default | Props | Fallback | 360 | | :-------- | :------ | :-------------------------------------------------------------------------------------------------------------------------------------------------------- | :------- | 361 | | -- | Yes | { executions: any; actions: { reload: () => Promise; create: () => Promise; get: (execution: string) => Promise; }} | -- | 362 | | error | No | { error: object } | -- | 363 | | loading | No | -- | -- | 364 | 365 | ### Events 366 | 367 | None. 368 | 369 | ## `Image` 370 | 371 | ### Props 372 | 373 | | Prop name | Kind | Reactive | Type | Default value | Description | 374 | | :-------- | :--------------- | :------- | :------------------ | --------------- | ----------- | 375 | | url | let | No | -- | -- | -- | 376 | | width | let | No | string | "" | -- | 377 | | height | let | No | string | "" | -- | 378 | 379 | ### Slots 380 | 381 | | Slot name | Default | Props | Fallback | 382 | | :-------- | :------ | :------------------------- | :------- | 383 | | -- | Yes | { src: any } | -- | 384 | 385 | ### Events 386 | 387 | None. 388 | 389 | ## `Languages` 390 | 391 | ### Props 392 | 393 | None. 394 | 395 | ### Slots 396 | 397 | | Slot name | Default | Props | Fallback | 398 | | :-------- | :------ | :--------------------------------------------------------------------------- | :------- | 399 | | -- | Yes | { languages: any; actions: { reload: () => Promise; }} | -- | 400 | | error | No | { error: object } | -- | 401 | | loading | No | -- | -- | 402 | 403 | ### Events 404 | 405 | None. 406 | 407 | ## `Locale` 408 | 409 | ### Props 410 | 411 | None. 412 | 413 | ### Slots 414 | 415 | | Slot name | Default | Props | Fallback | 416 | | :-------- | :------ | :---------------------------------------------------------------------- | :------- | 417 | | -- | Yes | { code: any; actions: { reload: () => Promise; }} | -- | 418 | | error | No | { error: object } | -- | 419 | | loading | No | -- | -- | 420 | 421 | ### Events 422 | 423 | None. 424 | 425 | ## `Preferences` 426 | 427 | ### Props 428 | 429 | None. 430 | 431 | ### Slots 432 | 433 | | Slot name | Default | Props | Fallback | 434 | | :-------- | :------ | :------------------------------------------------------------------------------------------------------ | :------- | 435 | | -- | Yes | { actions: { reload: () => Promise; update: (prefs: object) => Promise; } } | -- | 436 | | error | No | { error: object } | -- | 437 | | loading | No | -- | -- | 438 | 439 | ### Events 440 | 441 | None. 442 | 443 | ## `QR` 444 | 445 | ### Props 446 | 447 | | Prop name | Kind | Reactive | Type | Default value | Description | 448 | | :-------- | :--------------- | :------- | :------------------- | ------------------ | ----------- | 449 | | text | let | No | -- | -- | -- | 450 | | size | let | No | number | 400 | -- | 451 | | margin | let | No | number | 1 | -- | 452 | | download | let | No | boolean | false | -- | 453 | 454 | ### Slots 455 | 456 | | Slot name | Default | Props | Fallback | 457 | | :-------- | :------ | :------------------------- | :------- | 458 | | -- | Yes | { src: any } | -- | 459 | 460 | ### Events 461 | 462 | None. 463 | 464 | ## `RecoverPassword` 465 | 466 | ### Props 467 | 468 | None. 469 | 470 | ### Slots 471 | 472 | | Slot name | Default | Props | Fallback | 473 | | :-------- | :------ | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------- | 474 | | -- | Yes | { actions: { recover: (email: string, url: string) => Promise; complete: (user: string, secret: string, password: string, passwordAgain: string) => Promise; } } | -- | 475 | 476 | ### Events 477 | 478 | None. 479 | 480 | ## `Storage` 481 | 482 | ### Props 483 | 484 | None. 485 | 486 | ### Slots 487 | 488 | | Slot name | Default | Props | Fallback | 489 | | :-------- | :------ | :------------------------------------------------------------------------------------------------------- | :------- | 490 | | -- | Yes | { actions: { create: (file: any, read?: string[], write?: string[]) => Promise; }} | -- | 491 | | error | No | { error: object } | -- | 492 | 493 | ### Events 494 | 495 | | Event name | Type | Detail | 496 | | :--------- | :--------- | :----- | 497 | | upload | dispatched | -- | 498 | | success | dispatched | -- | 499 | | failure | dispatched | -- | 500 | 501 | ## `Update` 502 | 503 | ### Props 504 | 505 | None. 506 | 507 | ### Slots 508 | 509 | | Slot name | Default | Props | Fallback | 510 | | :-------- | :------ | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------- | 511 | | -- | Yes | { actions: { name: (name: string) => Promise; email: (email: string, password: string) => Promise; password: (password: string, oldPassword: string) => Promise; } } | -- | 512 | 513 | ### Events 514 | 515 | None. 516 | 517 | ## `User` 518 | 519 | ### Types 520 | 521 | ```ts 522 | export interface AppwriteUser { 523 | $id: string; 524 | email: string; 525 | emailVerification: boolean; 526 | name: string; 527 | registration: number; 528 | status: number; 529 | prefs: object; 530 | } 531 | ``` 532 | 533 | ### Props 534 | 535 | None. 536 | 537 | ### Slots 538 | 539 | | Slot name | Default | Props | Fallback | 540 | | :-------- | :------ | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------- | 541 | | -- | Yes | { user: AppwriteUser; actions: { reload: () => void; logout: () => Promise; logoutFrom: (session: string) => Promise; logoutAll: () => Promise; } } | -- | 542 | | error | No | { error: object } | -- | 543 | | loading | No | -- | -- | 544 | 545 | ### Events 546 | 547 | | Event name | Type | Detail | 548 | | :---------------- | :--------- | :----- | 549 | | success | dispatched | -- | 550 | | failure | dispatched | -- | 551 | | successLogout | dispatched | -- | 552 | | failureLogout | dispatched | -- | 553 | | successLogoutFrom | dispatched | -- | 554 | | failureLogoutFrom | dispatched | -- | 555 | | successLogoutAll | dispatched | -- | 556 | | failureLogoutAll | dispatched | -- | 557 | 558 | ## `Verification` 559 | 560 | ### Props 561 | 562 | None. 563 | 564 | ### Slots 565 | 566 | | Slot name | Default | Props | Fallback | 567 | | :-------- | :------ | :------------------------------------------------------------------------------------------------------------------------------------ | :------- | 568 | | -- | Yes | { actions: { create: (url: string) => Promise; complete: (user: string, secret: string) => Promise; } } | -- | 569 | 570 | ### Events 571 | 572 | None. 573 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2020, Appwrite 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | **⚠️ Warning - this SDK was designed to support Appwrite 0.9 and is not compatible with the latest Appwrite versions. We are planing to refactor it as part of the [SDK Generator](https://github.com/appwrite/sdk-generator) for better support and maintenance.** 2 | 3 | # svelte-appwrite (Beta) 4 | 5 | Easy to use [Appwrite](https://appwrite.io/) components for Svelte. Install it: 6 | 7 | ```bash 8 | npm install svelte-appwrite 9 | # or 10 | yarn svelte-appwrite 11 | ``` 12 | 13 | # Table of contents 14 | 15 | - [Usage](#usage) 16 | - [Initialize](#initialize) 17 | - [Create user](#create-user) 18 | - [Login via Email](#login-via-email) 19 | - [Login via OAuth2](#login-via-oauth2) 20 | - [Get user](#get-user) 21 | - [Get Collection](#get-collection) 22 | - [Get Document](#get-document) 23 | - [API](#api) 24 | - [Account](#account) 25 | - [``](#user-) 26 | - [``](#create-) 27 | - [``](#delete-) 28 | - [``](#preferences-) 29 | - [``](#recoverpassword-) 30 | - [``](#update-) 31 | - [Auth](#auth) 32 | - [``](#authemail-) 33 | - [``](#authoauth2-) 34 | - [Avatars](#avatars) 35 | - [``](#browser-) 36 | - [``](#creditcard-) 37 | - [``](#favicon-) 38 | - [``](#flag-) 39 | - [``](#image-) 40 | - [``](#qr-) 41 | - [Database](#database) 42 | - [``](#collection-) 43 | - [``](#document-) 44 | - [Storage](#storage) 45 | - [``](#storage-) 46 | - [``](#filelist-) 47 | - [``](#file-) 48 | - [Locale](#locale) 49 | - [``](#continents-) 50 | - [``](#countries-) 51 | - [``](#currencies-) 52 | - [``](#locale-) 53 | - [``](#phonecodes-) 54 | 55 | # Usage 56 | 57 | > You need a running instance of Appwrite to use this library. Go to https://appwrite.io/docs/installation for more instructions. 58 | 59 | **Psuedo Example** 60 | 61 | Handle multiple levels of async relational data (and their loading & fallback states) entirely from the Svelte HTML. 62 | 63 | 64 | ```svelte 65 | 66 | 67 | 68 | 69 | 70 | 71 |

Hello {user.name}!

72 | 73 | 74 | 75 | You have {documents.length} documents. 76 | 77 | {#each documents as document} 78 | 79 | 80 | 81 | Title: {document.title} 82 | Text: {document.text} 83 | ... 84 | ``` 85 | 86 | ## Initialize 87 | 88 | Must be initialised and wrap every `svelte-appwrite` component. 89 | 90 | ```svelte 91 | 100 | 101 | 102 | ... 103 | 104 | ``` 105 | 106 | ### Properties 107 | | Name | Description | 108 | | --- | --- | 109 | | `endpoint` | Your Appwrite endpoint | 110 | | `project` | Your project ID | 111 | | `locale` | _Optional_ The users locale | 112 | 113 | ## Create user 114 | 115 | Registers a new account. 116 | 117 | ```svelte 118 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | ``` 142 | 143 | ### Directives 144 | 145 | **let:actions** `object` 146 | 147 | Object with function. 148 | 149 | #### Arguments 150 | | Name | Description | 151 | | --- | --- | 152 | | `create(email, password, name)` | Registers a new user. | 153 | 154 | ### Events 155 | 156 | **on:success** 157 | 158 | Triggers on successful register. 159 | 160 | #### Arguments 161 | | Name | Description | 162 | | --- | --- | 163 | | `response` | Response | 164 | 165 | **on:failure** 166 | 167 | Triggers on failed register. 168 | 169 | #### Arguments 170 | | Name | Description | 171 | | --- | --- | 172 | | `response` | Response | 173 | 174 | ## Login via Email 175 | 176 | Login via email and password. 177 | 178 | ```svelte 179 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | ``` 201 | 202 | ### Directives 203 | 204 | **let:authorize** `function` 205 | 206 | Initiates login. 207 | 208 | #### Arguments 209 | | Name | Description | 210 | | --- | --- | 211 | | `email` | E-Mail | 212 | | `password` | Password | 213 | 214 | ### Events 215 | 216 | **on:success** 217 | 218 | Triggers on successful login. 219 | 220 | #### Arguments 221 | | Name | Description | 222 | | --- | --- | 223 | | `email` | E-Mail | 224 | 225 | **on:failure** 226 | 227 | Triggers on failed login. 228 | 229 | #### Arguments 230 | | Name | Description | 231 | | --- | --- | 232 | | `error` | Error object. | 233 | 234 | ## Login via OAuth2 235 | 236 | Login via an OAuth2 provider. 237 | 238 | ```svelte 239 | 242 | 243 | 248 | 249 | 250 | ``` 251 | 252 | ### Properties 253 | | Name | Description | 254 | | --- | --- | 255 | | `provider` | OAuth2 provider | 256 | | `success` | Success url | 257 | | `failure` | Failure url | 258 | 259 | ### Directives 260 | 261 | **let:authorize** `function` 262 | 263 | ## Get user 264 | 265 | Requests current user to check if logged in. 266 | 267 | ```svelte 268 | 271 | 272 | 273 |

Hello {user.name}!

274 |
{user.email}
275 | 276 |
277 | You are not logged in! 278 |
279 |
280 | ``` 281 | 282 | ### Directives 283 | 284 | **let:user** `object` 285 | 286 | Get currently logged in user data. 287 | 288 | ## Get Collection 289 | 290 | Get a list of all the documents from a collection. 291 | 292 | ```svelte 293 | 296 | 297 | 298 | You have {documents.length} documents. 299 | 300 | ``` 301 | 302 | ### Properties 303 | | Name | Description | 304 | | --- | --- | 305 | | `collection` | Collection unique ID. | 306 | | _additional_ | same as [here](https://appwrite.io/docs/client/database#listDocuments) | 307 | 308 | ### Directives 309 | 310 | **let:documents** `array` 311 | 312 | Array of documents. 313 | 314 | **let:actions** `object` 315 | 316 | Object with function. 317 | 318 | #### Arguments 319 | | Name | Description | 320 | | --- | --- | 321 | | `reload()` | Re-fetch collection. | 322 | | `create(data, read, write)` | Create a new Document in the collection. `read`/`write` is optional and current user by default. | 323 | 324 | ## Get Document 325 | 326 | Get a document. If you pass the `document` property with data from , there wont be any data requested. 327 | 328 | ```svelte 329 | 332 | 333 | 334 | Title: {document.title} 335 | Text: {document.text} 336 | 337 | ``` 338 | ### Properties 339 | | Name | Description | 340 | | --- | --- | 341 | | `id` | Document unique ID | 342 | | `collection` | Collection unique ID | 343 | | or | 344 | | `document` | Document passed from `` | 345 | 346 | ### Directives 347 | 348 | **let:document** `object` 349 | 350 | A JSON object with the document data. 351 | 352 | **let:actions** `object` 353 | 354 | Object with function. 355 | 356 | #### Arguments 357 | | Name | Description | 358 | | --- | --- | 359 | | `update(data)` | Update the document. | 360 | | `remove()` | Deletes the document. | 361 | | `reload()` | Re-fetch document. | 362 | 363 | ### Events 364 | 365 | **on:change** 366 | 367 | Triggers on update or remove login. 368 | 369 | # API 370 | 371 | ## Account 372 | The Account components allow you to manage a user account. 373 | 374 | ### `` 375 | 376 | #### Slots 377 | 378 | - **loading** 379 | - **error** 380 | 381 | #### Directives 382 | 383 | **let:actions** 384 | | Name | Description | 385 | | --- | --- | 386 | | `reload()` | Reload. | 387 | | `logout()` | Logout current session. | 388 | | `logoutAll()` | Logout from all session. | 389 | | `logoutFrom(session)` | Logout from specific session. | 390 | 391 | - **let:user** 392 | - **let:error** 393 | 394 | #### Events 395 | 396 | - **on:success** On user fetch success. 397 | - **on:failure** On user fetch failure. 398 | - **on:successLogout** On `logout` success. 399 | - **on:failureLogout** On `logout` failure. 400 | - **on:successLogoutFrom** On `logoutFrom` success. 401 | - **on:failureLogoutFrom** On `logoutFrom` failure. 402 | - **on:successLogoutAll** On `logoutAll` success. 403 | - **on:failureLogoutAll** On `logoutAll` failure. 404 | 405 | ### `` 406 | 407 | #### Directives 408 | 409 | **let:actions** 410 | | Name | Description | 411 | | --- | --- | 412 | | `create(email, password, name)` | Creates a user. | 413 | 414 | #### Events 415 | 416 | - **on:success** On `create` success. 417 | - **on:failure** On `create` failure. 418 | 419 | ### `` 420 | 421 | #### Directives 422 | 423 | **let:actions** 424 | | Name | Description | 425 | | --- | --- | 426 | | `delete()` | Deletes currently logged in user. | 427 | 428 | #### Events 429 | 430 | - **on:success** On `delete` success. 431 | - **on:failure** On `delete` failure. 432 | 433 | ### `` 434 | 435 | #### Slots 436 | 437 | - **loading** 438 | - **error** 439 | 440 | #### Directives 441 | 442 | **let:actions** 443 | | Name | Description | 444 | | --- | --- | 445 | | `reload()` | Reloads preferences. | 446 | | `update(prefs)` | Update preferences. | 447 | 448 | #### Events 449 | 450 | - **on:success** On init and `reload` success. 451 | - **on:failure** On init and `reload` failure. 452 | - **on:successUpdate** On `update` success. 453 | - **on:failureUpdate** On `update` failure. 454 | 455 | ### `` 456 | 457 | #### Directives 458 | 459 | **let:actions** 460 | | Name | Description | 461 | | --- | --- | 462 | | `recover(email, url)` | Recover password. | 463 | | `complete(user, secret, password, passwordAgain)` | Complete password recovery. | 464 | 465 | #### Events 466 | 467 | - **on:successRecover** On init and `reload` success. 468 | - **on:failureRecover** On init and `reload` failure. 469 | - **on:successComplete** On `update` success. 470 | - **on:failureComplete** On `update` failure. 471 | 472 | ### `` 473 | 474 | #### Directives 475 | 476 | **let:actions** 477 | | Name | Description | 478 | | --- | --- | 479 | | `name(name)` | Update name. | 480 | | `email(email, password)` | Update email. | 481 | | `password(password, oldPassword)` | Update password. | 482 | 483 | #### Events 484 | 485 | - **on:successName** On `name` success. 486 | - **on:failureName** On `name` failure. 487 | - **on:successEmail** On `email` success. 488 | - **on:failureEmail** On `email` failure. 489 | - **on:successPassword** On `password` success. 490 | - **on:failurePassword** On `password` failure. 491 | 492 | ### `` 493 | 494 | #### Directives 495 | 496 | **let:actions** 497 | | Name | Description | 498 | | --- | --- | 499 | | `create(url)` | Create Verification. | 500 | | `complete(user, secret)` | Complete Verification. | 501 | 502 | #### Events 503 | 504 | - **on:successCreate** On `create` success. 505 | - **on:failureCreate** On `create` failure. 506 | - **on:successComplete** On `complete` success. 507 | - **on:failureComplete** On `complete` failure. 508 | 509 | ## Auth 510 | The Auth components allow you to authenticate a user account. 511 | 512 | ### `` 513 | 514 | #### Slots 515 | 516 | - **loading** 517 | - **success** 518 | - **error** 519 | 520 | #### Directives 521 | 522 | - **let:authorize(email, password)** 523 | - **let:user** 524 | - **let:error** 525 | 526 | #### Events 527 | 528 | - **on:success** On `authorize` success. 529 | - **on:failure** On `authorize` failure. 530 | 531 | ### `` 532 | 533 | #### Properties 534 | | Name | Description | 535 | | --- | --- | 536 | | `provider` | OAuth2 provider | 537 | | `success` | Success url | 538 | | `failure` | Failure url | 539 | #### Directives 540 | 541 | **let:authorize()** 542 | 543 | ## Avatars 544 | The Avatar components aim to help you complete everyday tasks related to your app image, icons, and avatars. 545 | 546 | ### `` 547 | 548 | #### Arguments 549 | 550 | - code 551 | - width 552 | - height 553 | - quality 554 | 555 | #### Directives 556 | 557 | - **let:src** Image link 558 | 559 | ### `` 560 | 561 | #### Arguments 562 | 563 | - code 564 | - width 565 | - height 566 | - quality 567 | 568 | #### Directives 569 | 570 | - **let:src** Image link 571 | 572 | ### `` 573 | 574 | #### Arguments 575 | 576 | - url 577 | 578 | #### Directives 579 | 580 | - **let:src** Image link 581 | 582 | ### `` 583 | 584 | #### Arguments 585 | 586 | - code 587 | - width 588 | - height 589 | - quality 590 | 591 | #### Directives 592 | 593 | - **let:src** Image link 594 | 595 | ### `` 596 | 597 | #### Arguments 598 | 599 | - url 600 | - width 601 | - height 602 | 603 | #### Directives 604 | 605 | - **let:src** Image link 606 | 607 | ### `` 608 | 609 | #### Arguments 610 | 611 | - text 612 | - size 613 | - margin 614 | - download 615 | 616 | #### Directives 617 | 618 | - **let:src** Image link 619 | 620 | ## Database 621 | The Database components allow you to create structured collections of documents, query and filter lists of documents, and manage an advanced set of read and write access permissions. 622 | 623 | ### `` 624 | 625 | #### Arguments 626 | 627 | - id 628 | - filters 629 | - offset 630 | - limit 631 | - orderField 632 | - orderType 633 | - orderCast 634 | - search 635 | - first 636 | - last 637 | 638 | #### Slots 639 | 640 | - **loading** 641 | - **error** 642 | 643 | #### Directives 644 | 645 | **let:actions** 646 | | Name | Description | 647 | | --- | --- | 648 | | `reload()` | Reload. | 649 | | `create(data, read, write)` | Creates a Document. | 650 | 651 | - **let:documents** 652 | - **let:error** 653 | 654 | ### `` 655 | 656 | #### Arguments 657 | 658 | - id 659 | - collection 660 | - document 661 | 662 | #### Slots 663 | 664 | - **loading** 665 | - **error** 666 | 667 | #### Directives 668 | 669 | **let:actions** 670 | | Name | Description | 671 | | --- | --- | 672 | | `reload()` | Reload. | 673 | | `update(data)` | Updates a Document. | 674 | | `remove()` | Removes a Document. | 675 | 676 | - **let:document** 677 | - **let:error** 678 | 679 | ## Storage 680 | The Storage components allow you to manage your project files. You can upload, view, download, and query all your project files. 681 | 682 | ### `` 683 | 684 | #### Directives 685 | 686 | **let:actions** 687 | | Name | Description | 688 | | --- | --- | 689 | | `create(file, read, write)` | Uploads a file. | 690 | 691 | - **let:files** 692 | 693 | ### `` 694 | 695 | #### Arguments 696 | 697 | - search 698 | - limit 699 | - offset 700 | - orderType 701 | 702 | #### Slots 703 | 704 | - **loading** 705 | - **error** 706 | 707 | #### Directives 708 | 709 | **let:actions** 710 | | Name | Description | 711 | | --- | --- | 712 | | `reload()` | Reload. | 713 | 714 | - **let:files** 715 | - **let:error** 716 | 717 | ### `` 718 | 719 | #### Arguments 720 | 721 | - file 722 | 723 | #### Directives 724 | 725 | **let:actions** 726 | | Name | Description | 727 | | --- | --- | 728 | | `download()` | Downloads file. | 729 | | `view(as)` | Get file for View. | 730 | | `preview(width, height, quality, background, output)` | Get file for preview. | 731 | | `update(read, write)` | Updates a file. | 732 | | `delete()` | Deletes a file. | 733 | 734 | ## Locale 735 | The Locale components allow you to customize your app based on your users' location. 736 | 737 | ### `` 738 | 739 | #### Directives 740 | 741 | **let:actions** 742 | | Name | Description | 743 | | --- | --- | 744 | | `reload()` | Reload. | 745 | 746 | - **let:continents** 747 | 748 | #### Slots 749 | 750 | - **loading** 751 | - **error** 752 | 753 | ### `` 754 | 755 | #### Arguments 756 | 757 | - eu 758 | 759 | #### Slots 760 | 761 | - **loading** 762 | - **error** 763 | 764 | #### Directives 765 | 766 | **let:actions** 767 | | Name | Description | 768 | | --- | --- | 769 | | `reload()` | Reload. | 770 | 771 | - **let:countries** 772 | 773 | ### `` 774 | 775 | #### Slots 776 | 777 | - **loading** 778 | - **error** 779 | 780 | #### Directives 781 | 782 | **let:actions** 783 | | Name | Description | 784 | | --- | --- | 785 | | `reload()` | Reload. | 786 | 787 | - **let:currencies** 788 | 789 | ### `` 790 | 791 | #### Slots 792 | 793 | - **loading** 794 | - **error** 795 | 796 | #### Directives 797 | 798 | **let:actions** 799 | | Name | Description | 800 | | --- | --- | 801 | | `reload()` | Reload. | 802 | 803 | - **let:code** 804 | 805 | ### `` 806 | 807 | #### Slots 808 | 809 | - **loading** 810 | - **error** 811 | 812 | #### Directives 813 | 814 | **let:actions** 815 | | Name | Description | 816 | | --- | --- | 817 | | `reload()` | Reload. | 818 | 819 | - **let:codes** 820 | 821 | -------------------------------------------------------------------------------- /demo/.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules/ 2 | /public/build/ 3 | 4 | .DS_Store 5 | -------------------------------------------------------------------------------- /demo/README.md: -------------------------------------------------------------------------------- 1 | *Looking for a shareable component template? Go here --> [sveltejs/component-template](https://github.com/sveltejs/component-template)* 2 | 3 | --- 4 | 5 | # svelte app 6 | 7 | This is a project template for [Svelte](https://svelte.dev) apps. It lives at https://github.com/sveltejs/template. 8 | 9 | To create a new project based on this template using [degit](https://github.com/Rich-Harris/degit): 10 | 11 | ```bash 12 | npx degit sveltejs/template svelte-app 13 | cd svelte-app 14 | ``` 15 | 16 | *Note that you will need to have [Node.js](https://nodejs.org) installed.* 17 | 18 | 19 | ## Get started 20 | 21 | Install the dependencies... 22 | 23 | ```bash 24 | cd svelte-app 25 | npm install 26 | ``` 27 | 28 | ...then start [Rollup](https://rollupjs.org): 29 | 30 | ```bash 31 | npm run dev 32 | ``` 33 | 34 | Navigate to [localhost:5000](http://localhost:5000). You should see your app running. Edit a component file in `src`, save it, and reload the page to see your changes. 35 | 36 | By default, the server will only respond to requests from localhost. To allow connections from other computers, edit the `sirv` commands in package.json to include the option `--host 0.0.0.0`. 37 | 38 | 39 | ## Building and running in production mode 40 | 41 | To create an optimised version of the app: 42 | 43 | ```bash 44 | npm run build 45 | ``` 46 | 47 | You can run the newly built app with `npm run start`. This uses [sirv](https://github.com/lukeed/sirv), which is included in your package.json's `dependencies` so that the app will work when you deploy to platforms like [Heroku](https://heroku.com). 48 | 49 | 50 | ## Single-page app mode 51 | 52 | By default, sirv will only respond to requests that match files in `public`. This is to maximise compatibility with static fileservers, allowing you to deploy your app anywhere. 53 | 54 | If you're building a single-page app (SPA) with multiple routes, sirv needs to be able to respond to requests for *any* path. You can make it so by editing the `"start"` command in package.json: 55 | 56 | ```js 57 | "start": "sirv public --single" 58 | ``` 59 | 60 | ## Using TypeScript 61 | 62 | This template comes with a script to set up a TypeScript development environment, you can run it immediately after cloning the template with: 63 | 64 | ```bash 65 | node scripts/setupTypeScript.js 66 | ``` 67 | 68 | Or remove the script via: 69 | 70 | ```bash 71 | rm scripts/setupTypeScript.js 72 | ``` 73 | 74 | ## Deploying to the web 75 | 76 | ### With [Vercel](https://vercel.com) 77 | 78 | Install `vercel` if you haven't already: 79 | 80 | ```bash 81 | npm install -g vercel 82 | ``` 83 | 84 | Then, from within your project folder: 85 | 86 | ```bash 87 | cd public 88 | vercel deploy --name my-project 89 | ``` 90 | 91 | ### With [surge](https://surge.sh/) 92 | 93 | Install `surge` if you haven't already: 94 | 95 | ```bash 96 | npm install -g surge 97 | ``` 98 | 99 | Then, from within your project folder: 100 | 101 | ```bash 102 | npm run build 103 | surge public my-project.surge.sh 104 | ``` 105 | -------------------------------------------------------------------------------- /demo/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "svelte-app", 3 | "version": "1.0.0", 4 | "scripts": { 5 | "build": "rollup -c", 6 | "dev": "rollup -c -w", 7 | "start": "sirv public" 8 | }, 9 | "devDependencies": { 10 | "@rollup/plugin-commonjs": "^14.0.0", 11 | "@rollup/plugin-node-resolve": "^8.0.0", 12 | "rollup": "^2.3.4", 13 | "rollup-plugin-livereload": "^2.0.0", 14 | "rollup-plugin-svelte": "^6.0.0", 15 | "rollup-plugin-terser": "^7.0.0", 16 | "svelte": "^3.0.0" 17 | }, 18 | "dependencies": { 19 | "sirv-cli": "^1.0.0", 20 | "svelte-appwrite": "../" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /demo/public/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/appwrite/sdk-for-svelte/b1139c89da5513537f12a0d57eb3b919f64b7633/demo/public/favicon.png -------------------------------------------------------------------------------- /demo/public/global.css: -------------------------------------------------------------------------------- 1 | html, body { 2 | position: relative; 3 | width: 100%; 4 | height: 100%; 5 | } 6 | 7 | body { 8 | color: #333; 9 | margin: 0; 10 | padding: 8px; 11 | box-sizing: border-box; 12 | font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; 13 | } 14 | 15 | a { 16 | color: rgb(0,100,200); 17 | text-decoration: none; 18 | } 19 | 20 | a:hover { 21 | text-decoration: underline; 22 | } 23 | 24 | a:visited { 25 | color: rgb(0,80,160); 26 | } 27 | 28 | label { 29 | display: block; 30 | } 31 | 32 | input, button, select, textarea { 33 | font-family: inherit; 34 | font-size: inherit; 35 | -webkit-padding: 0.4em 0; 36 | padding: 0.4em; 37 | margin: 0 0 0.5em 0; 38 | box-sizing: border-box; 39 | border: 1px solid #ccc; 40 | border-radius: 2px; 41 | } 42 | 43 | input:disabled { 44 | color: #ccc; 45 | } 46 | 47 | button { 48 | color: #333; 49 | background-color: #f4f4f4; 50 | outline: none; 51 | } 52 | 53 | button:disabled { 54 | color: #999; 55 | } 56 | 57 | button:not(:disabled):active { 58 | background-color: #ddd; 59 | } 60 | 61 | button:focus { 62 | border-color: #666; 63 | } 64 | -------------------------------------------------------------------------------- /demo/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Appwrite Svelte Example 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /demo/rollup.config.js: -------------------------------------------------------------------------------- 1 | import svelte from "rollup-plugin-svelte"; 2 | import resolve from "@rollup/plugin-node-resolve"; 3 | import commonjs from "@rollup/plugin-commonjs"; 4 | import livereload from "rollup-plugin-livereload"; 5 | import { terser } from "rollup-plugin-terser"; 6 | 7 | const production = !process.env.ROLLUP_WATCH; 8 | 9 | function serve() { 10 | let server; 11 | 12 | function toExit() { 13 | if (server) server.kill(0); 14 | } 15 | 16 | return { 17 | writeBundle() { 18 | if (server) return; 19 | server = require("child_process").spawn( 20 | "npm", 21 | ["run", "start", "--", "--dev"], 22 | { 23 | stdio: ["ignore", "inherit", "inherit"], 24 | shell: true, 25 | } 26 | ); 27 | 28 | process.on("SIGTERM", toExit); 29 | process.on("exit", toExit); 30 | }, 31 | }; 32 | } 33 | 34 | export default { 35 | input: "src/main.js", 36 | output: { 37 | sourcemap: true, 38 | format: "iife", 39 | name: "app", 40 | file: "public/build/bundle.js", 41 | }, 42 | plugins: [ 43 | svelte({ 44 | // enable run-time checks when not in production 45 | dev: !production, 46 | // we'll extract any component CSS out into 47 | // a separate file - better for performance 48 | css: css => { 49 | css.write("bundle.css"); 50 | }, 51 | }), 52 | 53 | // If you have external dependencies installed from 54 | // npm, you'll most likely need these plugins. In 55 | // some cases you'll need additional configuration - 56 | // consult the documentation for details: 57 | // https://github.com/rollup/plugins/tree/master/packages/commonjs 58 | resolve({ 59 | browser: true, 60 | dedupe: ["svelte"], 61 | }), 62 | commonjs(), 63 | 64 | // In dev mode, call `npm run start` once 65 | // the bundle has been generated 66 | !production && serve(), 67 | 68 | // Watch the `public` directory and refresh the 69 | // browser on changes when not in production 70 | !production && livereload("public"), 71 | 72 | // If we're building for production (npm run build 73 | // instead of npm run dev), minify 74 | production && terser(), 75 | ], 76 | watch: { 77 | clearScreen: false, 78 | }, 79 | }; 80 | -------------------------------------------------------------------------------- /demo/src/App.svelte: -------------------------------------------------------------------------------- 1 | 20 | 21 |
22 | 23 | 24 |

Hello {user.name}!

25 |
{user.email}
26 | 27 | {#if code.countryCode != "--"} 28 | 29 | You are from {code.country} 30 | 31 | {/if} 32 | 33 |
34 | 35 | The world has {Object.keys(countries.countries).length} countries! 36 | 37 |
38 | 39 | The european union has {Object.keys(countries.countries).length} members! 40 | 41 |
42 | 43 | 44 | 45 |
46 | 51 | 52 | 53 | 58 | 59 | 60 | 65 | 66 | 67 |
68 | 69 |
70 |
71 |
72 |
73 | 74 | 89 | -------------------------------------------------------------------------------- /demo/src/Gallery.svelte: -------------------------------------------------------------------------------- 1 | 11 | 12 |

Gallery

13 | 14 | 15 | 16 | 17 |
18 | {#each files as file} 19 | 20 | 21 | {file.name} 22 | 23 | 24 | {/each} 25 |
26 | -------------------------------------------------------------------------------- /demo/src/Login.svelte: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | {error} 14 |
15 |
-------------------------------------------------------------------------------- /demo/src/TodoList.svelte: -------------------------------------------------------------------------------- 1 | 11 | 12 |

TodoList

13 | 14 |
15 | 16 |
17 | 18 | {#each documents.sort(x => x.done ? 1 : -1) as document} 19 | 20 | 21 | 27 | 28 | 33 | 34 | 35 | {/each} 36 |
22 | 26 | {document.label} 29 | {#if document.done} 30 | remove 31 | {/if} 32 |
37 |
38 |

Collection not found, you have to create following collection with following rules in Appwrite:

39 |
40 |       - label: text
41 |       - done: boolean
42 |     
43 |

Now paste the collection id in TodoList.svelte.

44 |
45 |
46 | 47 | -------------------------------------------------------------------------------- /demo/src/main.js: -------------------------------------------------------------------------------- 1 | import App from "./App.svelte"; 2 | 3 | const app = new App({ 4 | target: document.body, 5 | }); 6 | 7 | export default app; 8 | -------------------------------------------------------------------------------- /demo/yarn.lock: -------------------------------------------------------------------------------- 1 | # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. 2 | # yarn lockfile v1 3 | 4 | 5 | "@babel/code-frame@^7.10.4": 6 | version "7.10.4" 7 | resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.10.4.tgz#168da1a36e90da68ae8d49c0f1b48c7c6249213a" 8 | integrity sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg== 9 | dependencies: 10 | "@babel/highlight" "^7.10.4" 11 | 12 | "@babel/helper-validator-identifier@^7.10.4": 13 | version "7.10.4" 14 | resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz#a78c7a7251e01f616512d31b10adcf52ada5e0d2" 15 | integrity sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw== 16 | 17 | "@babel/highlight@^7.10.4": 18 | version "7.10.4" 19 | resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.10.4.tgz#7d1bdfd65753538fabe6c38596cdb76d9ac60143" 20 | integrity sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA== 21 | dependencies: 22 | "@babel/helper-validator-identifier" "^7.10.4" 23 | chalk "^2.0.0" 24 | js-tokens "^4.0.0" 25 | 26 | "@polka/url@^1.0.0-next.9": 27 | version "1.0.0-next.11" 28 | resolved "https://registry.yarnpkg.com/@polka/url/-/url-1.0.0-next.11.tgz#aeb16f50649a91af79dbe36574b66d0f9e4d9f71" 29 | integrity sha512-3NsZsJIA/22P3QUyrEDNA2D133H4j224twJrdipXN38dpnIOzAbUDtOwkcJ5pXmn75w7LSQDjA4tO9dm1XlqlA== 30 | 31 | "@rollup/plugin-commonjs@^14.0.0": 32 | version "14.0.0" 33 | resolved "https://registry.yarnpkg.com/@rollup/plugin-commonjs/-/plugin-commonjs-14.0.0.tgz#4285f9ec2db686a31129e5a2b415c94aa1f836f0" 34 | integrity sha512-+PSmD9ePwTAeU106i9FRdc+Zb3XUWyW26mo5Atr2mk82hor8+nPwkztEjFo8/B1fJKfaQDg9aM2bzQkjhi7zOw== 35 | dependencies: 36 | "@rollup/pluginutils" "^3.0.8" 37 | commondir "^1.0.1" 38 | estree-walker "^1.0.1" 39 | glob "^7.1.2" 40 | is-reference "^1.1.2" 41 | magic-string "^0.25.2" 42 | resolve "^1.11.0" 43 | 44 | "@rollup/plugin-node-resolve@^8.0.0": 45 | version "8.4.0" 46 | resolved "https://registry.yarnpkg.com/@rollup/plugin-node-resolve/-/plugin-node-resolve-8.4.0.tgz#261d79a680e9dc3d86761c14462f24126ba83575" 47 | integrity sha512-LFqKdRLn0ShtQyf6SBYO69bGE1upV6wUhBX0vFOUnLAyzx5cwp8svA0eHUnu8+YU57XOkrMtfG63QOpQx25pHQ== 48 | dependencies: 49 | "@rollup/pluginutils" "^3.1.0" 50 | "@types/resolve" "1.17.1" 51 | builtin-modules "^3.1.0" 52 | deep-freeze "^0.0.1" 53 | deepmerge "^4.2.2" 54 | is-module "^1.0.0" 55 | resolve "^1.17.0" 56 | 57 | "@rollup/pluginutils@^3.0.8", "@rollup/pluginutils@^3.1.0": 58 | version "3.1.0" 59 | resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-3.1.0.tgz#706b4524ee6dc8b103b3c995533e5ad680c02b9b" 60 | integrity sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg== 61 | dependencies: 62 | "@types/estree" "0.0.39" 63 | estree-walker "^1.0.1" 64 | picomatch "^2.2.2" 65 | 66 | "@types/estree@*": 67 | version "0.0.45" 68 | resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.45.tgz#e9387572998e5ecdac221950dab3e8c3b16af884" 69 | integrity sha512-jnqIUKDUqJbDIUxm0Uj7bnlMnRm1T/eZ9N+AVMqhPgzrba2GhGG5o/jCTwmdPK709nEZsGoMzXEDUjcXHa3W0g== 70 | 71 | "@types/estree@0.0.39": 72 | version "0.0.39" 73 | resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f" 74 | integrity sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw== 75 | 76 | "@types/node@*": 77 | version "14.6.4" 78 | resolved "https://registry.yarnpkg.com/@types/node/-/node-14.6.4.tgz#a145cc0bb14ef9c4777361b7bbafa5cf8e3acb5a" 79 | integrity sha512-Wk7nG1JSaMfMpoMJDKUsWYugliB2Vy55pdjLpmLixeyMi7HizW2I/9QoxsPCkXl3dO+ZOVqPumKaDUv5zJu2uQ== 80 | 81 | "@types/resolve@1.17.1": 82 | version "1.17.1" 83 | resolved "https://registry.yarnpkg.com/@types/resolve/-/resolve-1.17.1.tgz#3afd6ad8967c77e4376c598a82ddd58f46ec45d6" 84 | integrity sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw== 85 | dependencies: 86 | "@types/node" "*" 87 | 88 | ansi-styles@^3.2.1: 89 | version "3.2.1" 90 | resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" 91 | integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== 92 | dependencies: 93 | color-convert "^1.9.0" 94 | 95 | anymatch@~3.1.1: 96 | version "3.1.1" 97 | resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.1.tgz#c55ecf02185e2469259399310c173ce31233b142" 98 | integrity sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg== 99 | dependencies: 100 | normalize-path "^3.0.0" 101 | picomatch "^2.0.4" 102 | 103 | appwrite@^2.0.0: 104 | version "2.0.0" 105 | resolved "https://registry.yarnpkg.com/appwrite/-/appwrite-2.0.0.tgz#9df1bbbfe98c080b4b95b38918c1ba33e66caf6f" 106 | integrity sha512-2hTZsh8HgjRwCja+BB487M5a53nR+1ofV8h922XJ6J50fMSuXyjY58At1sc32ktLDYtX6QmRxvv/Ep9CZngTnw== 107 | 108 | async-limiter@~1.0.0: 109 | version "1.0.1" 110 | resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.1.tgz#dd379e94f0db8310b08291f9d64c3209766617fd" 111 | integrity sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ== 112 | 113 | balanced-match@^1.0.0: 114 | version "1.0.0" 115 | resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" 116 | integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= 117 | 118 | binary-extensions@^2.0.0: 119 | version "2.1.0" 120 | resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.1.0.tgz#30fa40c9e7fe07dbc895678cd287024dea241dd9" 121 | integrity sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ== 122 | 123 | brace-expansion@^1.1.7: 124 | version "1.1.11" 125 | resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" 126 | integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== 127 | dependencies: 128 | balanced-match "^1.0.0" 129 | concat-map "0.0.1" 130 | 131 | braces@~3.0.2: 132 | version "3.0.2" 133 | resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" 134 | integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== 135 | dependencies: 136 | fill-range "^7.0.1" 137 | 138 | buffer-from@^1.0.0: 139 | version "1.1.1" 140 | resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" 141 | integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== 142 | 143 | builtin-modules@^3.1.0: 144 | version "3.1.0" 145 | resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-3.1.0.tgz#aad97c15131eb76b65b50ef208e7584cd76a7484" 146 | integrity sha512-k0KL0aWZuBt2lrxrcASWDfwOLMnodeQjodT/1SxEQAXsHANgo6ZC/VEaSEHCXt7aSTZ4/4H5LKa+tBXmW7Vtvw== 147 | 148 | chalk@^2.0.0: 149 | version "2.4.2" 150 | resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" 151 | integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== 152 | dependencies: 153 | ansi-styles "^3.2.1" 154 | escape-string-regexp "^1.0.5" 155 | supports-color "^5.3.0" 156 | 157 | chokidar@^3.3.0: 158 | version "3.4.2" 159 | resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.4.2.tgz#38dc8e658dec3809741eb3ef7bb0a47fe424232d" 160 | integrity sha512-IZHaDeBeI+sZJRX7lGcXsdzgvZqKv6sECqsbErJA4mHWfpRrD8B97kSFN4cQz6nGBGiuFia1MKR4d6c1o8Cv7A== 161 | dependencies: 162 | anymatch "~3.1.1" 163 | braces "~3.0.2" 164 | glob-parent "~5.1.0" 165 | is-binary-path "~2.1.0" 166 | is-glob "~4.0.1" 167 | normalize-path "~3.0.0" 168 | readdirp "~3.4.0" 169 | optionalDependencies: 170 | fsevents "~2.1.2" 171 | 172 | color-convert@^1.9.0: 173 | version "1.9.3" 174 | resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" 175 | integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== 176 | dependencies: 177 | color-name "1.1.3" 178 | 179 | color-name@1.1.3: 180 | version "1.1.3" 181 | resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" 182 | integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= 183 | 184 | commander@^2.20.0: 185 | version "2.20.3" 186 | resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" 187 | integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== 188 | 189 | commondir@^1.0.1: 190 | version "1.0.1" 191 | resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" 192 | integrity sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs= 193 | 194 | concat-map@0.0.1: 195 | version "0.0.1" 196 | resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" 197 | integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= 198 | 199 | console-clear@^1.1.0: 200 | version "1.1.1" 201 | resolved "https://registry.yarnpkg.com/console-clear/-/console-clear-1.1.1.tgz#995e20cbfbf14dd792b672cde387bd128d674bf7" 202 | integrity sha512-pMD+MVR538ipqkG5JXeOEbKWS5um1H4LUUccUQG68qpeqBYbzYy79Gh55jkd2TtPdRfUaLWdv6LPP//5Zt0aPQ== 203 | 204 | deep-freeze@^0.0.1: 205 | version "0.0.1" 206 | resolved "https://registry.yarnpkg.com/deep-freeze/-/deep-freeze-0.0.1.tgz#3a0b0005de18672819dfd38cd31f91179c893e84" 207 | integrity sha1-OgsABd4YZygZ39OM0x+RF5yJPoQ= 208 | 209 | deepmerge@^4.2.2: 210 | version "4.2.2" 211 | resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.2.2.tgz#44d2ea3679b8f4d4ffba33f03d865fc1e7bf4955" 212 | integrity sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg== 213 | 214 | escape-string-regexp@^1.0.5: 215 | version "1.0.5" 216 | resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" 217 | integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= 218 | 219 | estree-walker@^0.6.1: 220 | version "0.6.1" 221 | resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-0.6.1.tgz#53049143f40c6eb918b23671d1fe3219f3a1b362" 222 | integrity sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w== 223 | 224 | estree-walker@^1.0.1: 225 | version "1.0.1" 226 | resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-1.0.1.tgz#31bc5d612c96b704106b477e6dd5d8aa138cb700" 227 | integrity sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg== 228 | 229 | fill-range@^7.0.1: 230 | version "7.0.1" 231 | resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" 232 | integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== 233 | dependencies: 234 | to-regex-range "^5.0.1" 235 | 236 | fs.realpath@^1.0.0: 237 | version "1.0.0" 238 | resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" 239 | integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= 240 | 241 | fsevents@~2.1.2: 242 | version "2.1.3" 243 | resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.1.3.tgz#fb738703ae8d2f9fe900c33836ddebee8b97f23e" 244 | integrity sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ== 245 | 246 | get-port@^3.2.0: 247 | version "3.2.0" 248 | resolved "https://registry.yarnpkg.com/get-port/-/get-port-3.2.0.tgz#dd7ce7de187c06c8bf353796ac71e099f0980ebc" 249 | integrity sha1-3Xzn3hh8Bsi/NTeWrHHgmfCYDrw= 250 | 251 | glob-parent@~5.1.0: 252 | version "5.1.1" 253 | resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.1.tgz#b6c1ef417c4e5663ea498f1c45afac6916bbc229" 254 | integrity sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ== 255 | dependencies: 256 | is-glob "^4.0.1" 257 | 258 | glob@^7.1.2: 259 | version "7.1.6" 260 | resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6" 261 | integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA== 262 | dependencies: 263 | fs.realpath "^1.0.0" 264 | inflight "^1.0.4" 265 | inherits "2" 266 | minimatch "^3.0.4" 267 | once "^1.3.0" 268 | path-is-absolute "^1.0.0" 269 | 270 | has-flag@^3.0.0: 271 | version "3.0.0" 272 | resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" 273 | integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= 274 | 275 | has-flag@^4.0.0: 276 | version "4.0.0" 277 | resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" 278 | integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== 279 | 280 | inflight@^1.0.4: 281 | version "1.0.6" 282 | resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" 283 | integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= 284 | dependencies: 285 | once "^1.3.0" 286 | wrappy "1" 287 | 288 | inherits@2: 289 | version "2.0.4" 290 | resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" 291 | integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== 292 | 293 | is-binary-path@~2.1.0: 294 | version "2.1.0" 295 | resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" 296 | integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== 297 | dependencies: 298 | binary-extensions "^2.0.0" 299 | 300 | is-extglob@^2.1.1: 301 | version "2.1.1" 302 | resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" 303 | integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= 304 | 305 | is-glob@^4.0.1, is-glob@~4.0.1: 306 | version "4.0.1" 307 | resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc" 308 | integrity sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg== 309 | dependencies: 310 | is-extglob "^2.1.1" 311 | 312 | is-module@^1.0.0: 313 | version "1.0.0" 314 | resolved "https://registry.yarnpkg.com/is-module/-/is-module-1.0.0.tgz#3258fb69f78c14d5b815d664336b4cffb6441591" 315 | integrity sha1-Mlj7afeMFNW4FdZkM2tM/7ZEFZE= 316 | 317 | is-number@^7.0.0: 318 | version "7.0.0" 319 | resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" 320 | integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== 321 | 322 | is-reference@^1.1.2: 323 | version "1.2.1" 324 | resolved "https://registry.yarnpkg.com/is-reference/-/is-reference-1.2.1.tgz#8b2dac0b371f4bc994fdeaba9eb542d03002d0b7" 325 | integrity sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ== 326 | dependencies: 327 | "@types/estree" "*" 328 | 329 | jest-worker@^26.2.1: 330 | version "26.3.0" 331 | resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-26.3.0.tgz#7c8a97e4f4364b4f05ed8bca8ca0c24de091871f" 332 | integrity sha512-Vmpn2F6IASefL+DVBhPzI2J9/GJUsqzomdeN+P+dK8/jKxbh8R3BtFnx3FIta7wYlPU62cpJMJQo4kuOowcMnw== 333 | dependencies: 334 | "@types/node" "*" 335 | merge-stream "^2.0.0" 336 | supports-color "^7.0.0" 337 | 338 | js-tokens@^4.0.0: 339 | version "4.0.0" 340 | resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" 341 | integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== 342 | 343 | kleur@^3.0.0: 344 | version "3.0.3" 345 | resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e" 346 | integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w== 347 | 348 | livereload-js@^3.1.0: 349 | version "3.3.1" 350 | resolved "https://registry.yarnpkg.com/livereload-js/-/livereload-js-3.3.1.tgz#61f887468086762e61fb2987412cf9d1dda99202" 351 | integrity sha512-CBu1gTEfzVhlOK1WASKAAJ9Qx1fHECTq0SUB67sfxwQssopTyvzqTlgl+c0h9pZ6V+Fzd2rc510ppuNusg9teQ== 352 | 353 | livereload@^0.9.1: 354 | version "0.9.1" 355 | resolved "https://registry.yarnpkg.com/livereload/-/livereload-0.9.1.tgz#65125dabdf2db4fd3f1169e953fe56e3bcc6f477" 356 | integrity sha512-9g7sua11kkyZNo2hLRCG3LuZZwqexoyEyecSlV8cAsfAVVCZqLzVir6XDqmH0r+Vzgnd5LrdHDMyjtFnJQLAYw== 357 | dependencies: 358 | chokidar "^3.3.0" 359 | livereload-js "^3.1.0" 360 | opts ">= 1.2.0" 361 | ws "^6.2.1" 362 | 363 | local-access@^1.0.1: 364 | version "1.0.1" 365 | resolved "https://registry.yarnpkg.com/local-access/-/local-access-1.0.1.tgz#5121258146d64e869046c642ea4f1dd39ff942bb" 366 | integrity sha512-ykt2pgN0aqIy6KQC1CqdWTWkmUwNgaOS6dcpHVjyBJONA+Xi7AtSB1vuxC/U/0tjIP3wcRudwQk1YYzUvzk2bA== 367 | 368 | magic-string@^0.25.2: 369 | version "0.25.7" 370 | resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.25.7.tgz#3f497d6fd34c669c6798dcb821f2ef31f5445051" 371 | integrity sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA== 372 | dependencies: 373 | sourcemap-codec "^1.4.4" 374 | 375 | merge-stream@^2.0.0: 376 | version "2.0.0" 377 | resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" 378 | integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== 379 | 380 | mime@^2.3.1: 381 | version "2.4.6" 382 | resolved "https://registry.yarnpkg.com/mime/-/mime-2.4.6.tgz#e5b407c90db442f2beb5b162373d07b69affa4d1" 383 | integrity sha512-RZKhC3EmpBchfTGBVb8fb+RL2cWyw/32lshnsETttkBAyAUXSGHxbEJWWRXc751DrIxG1q04b8QwMbAwkRPpUA== 384 | 385 | minimatch@^3.0.4: 386 | version "3.0.4" 387 | resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" 388 | integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== 389 | dependencies: 390 | brace-expansion "^1.1.7" 391 | 392 | mri@^1.1.0: 393 | version "1.1.6" 394 | resolved "https://registry.yarnpkg.com/mri/-/mri-1.1.6.tgz#49952e1044db21dbf90f6cd92bc9c9a777d415a6" 395 | integrity sha512-oi1b3MfbyGa7FJMP9GmLTttni5JoICpYBRlq+x5V16fZbLsnL9N3wFqqIm/nIG43FjUFkFh9Epzp/kzUGUnJxQ== 396 | 397 | normalize-path@^3.0.0, normalize-path@~3.0.0: 398 | version "3.0.0" 399 | resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" 400 | integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== 401 | 402 | once@^1.3.0: 403 | version "1.4.0" 404 | resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" 405 | integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= 406 | dependencies: 407 | wrappy "1" 408 | 409 | "opts@>= 1.2.0": 410 | version "2.0.2" 411 | resolved "https://registry.yarnpkg.com/opts/-/opts-2.0.2.tgz#a17e189fbbfee171da559edd8a42423bc5993ce1" 412 | integrity sha512-k41FwbcLnlgnFh69f4qdUfvDQ+5vaSDnVPFI/y5XuhKRq97EnVVneO9F1ESVCdiVu4fCS2L8usX3mU331hB7pg== 413 | 414 | path-is-absolute@^1.0.0: 415 | version "1.0.1" 416 | resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" 417 | integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= 418 | 419 | path-parse@^1.0.6: 420 | version "1.0.6" 421 | resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" 422 | integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== 423 | 424 | picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.2: 425 | version "2.2.2" 426 | resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.2.2.tgz#21f333e9b6b8eaff02468f5146ea406d345f4dad" 427 | integrity sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg== 428 | 429 | randombytes@^2.1.0: 430 | version "2.1.0" 431 | resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" 432 | integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== 433 | dependencies: 434 | safe-buffer "^5.1.0" 435 | 436 | readdirp@~3.4.0: 437 | version "3.4.0" 438 | resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.4.0.tgz#9fdccdf9e9155805449221ac645e8303ab5b9ada" 439 | integrity sha512-0xe001vZBnJEK+uKcj8qOhyAKPzIT+gStxWr3LCB0DwcXR5NZJ3IaC+yGnHCYzB/S7ov3m3EEbZI2zeNvX+hGQ== 440 | dependencies: 441 | picomatch "^2.2.1" 442 | 443 | require-relative@^0.8.7: 444 | version "0.8.7" 445 | resolved "https://registry.yarnpkg.com/require-relative/-/require-relative-0.8.7.tgz#7999539fc9e047a37928fa196f8e1563dabd36de" 446 | integrity sha1-eZlTn8ngR6N5KPoZb44VY9q9Nt4= 447 | 448 | resolve@^1.11.0, resolve@^1.17.0: 449 | version "1.17.0" 450 | resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.17.0.tgz#b25941b54968231cc2d1bb76a79cb7f2c0bf8444" 451 | integrity sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w== 452 | dependencies: 453 | path-parse "^1.0.6" 454 | 455 | rollup-plugin-livereload@^2.0.0: 456 | version "2.0.0" 457 | resolved "https://registry.yarnpkg.com/rollup-plugin-livereload/-/rollup-plugin-livereload-2.0.0.tgz#d3928d74e8cf2ae4286c5dd46b770fd3f3b82313" 458 | integrity sha512-oC/8NqumGYuphkqrfszOHUUIwzKsaHBICw6QRwT5uD07gvePTS+HW+GFwu6f9K8W02CUuTvtIM9AWJrbj4wE1A== 459 | dependencies: 460 | livereload "^0.9.1" 461 | 462 | rollup-plugin-svelte@^6.0.0: 463 | version "6.0.0" 464 | resolved "https://registry.yarnpkg.com/rollup-plugin-svelte/-/rollup-plugin-svelte-6.0.0.tgz#a5b15354371ec17fe67bd4def4d4ea1b915f74cb" 465 | integrity sha512-y9qtWa+iNYwXdOZqaEqz3i6k3gzofC9JXzv+WVKDOt0DLiJxJaSrlKKf4YkKG91RzTK5Lo+0fW8in9QH/DxEhA== 466 | dependencies: 467 | require-relative "^0.8.7" 468 | rollup-pluginutils "^2.8.2" 469 | sourcemap-codec "^1.4.8" 470 | 471 | rollup-plugin-terser@^7.0.0: 472 | version "7.0.2" 473 | resolved "https://registry.yarnpkg.com/rollup-plugin-terser/-/rollup-plugin-terser-7.0.2.tgz#e8fbba4869981b2dc35ae7e8a502d5c6c04d324d" 474 | integrity sha512-w3iIaU4OxcF52UUXiZNsNeuXIMDvFrr+ZXK6bFZ0Q60qyVfq4uLptoS4bbq3paG3x216eQllFZX7zt6TIImguQ== 475 | dependencies: 476 | "@babel/code-frame" "^7.10.4" 477 | jest-worker "^26.2.1" 478 | serialize-javascript "^4.0.0" 479 | terser "^5.0.0" 480 | 481 | rollup-pluginutils@^2.8.2: 482 | version "2.8.2" 483 | resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz#72f2af0748b592364dbd3389e600e5a9444a351e" 484 | integrity sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ== 485 | dependencies: 486 | estree-walker "^0.6.1" 487 | 488 | rollup@^2.3.4: 489 | version "2.26.10" 490 | resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.26.10.tgz#0ffe0390d35f07af850382f22f1b8525c7f57f07" 491 | integrity sha512-dUnjCWOA0h9qNX6qtcHidyatz8FAFZxVxt1dbcGtKdlJkpSxGK3G9+DLCYvtZr9v94D129ij9zUhG+xbRoqepw== 492 | optionalDependencies: 493 | fsevents "~2.1.2" 494 | 495 | sade@^1.6.0: 496 | version "1.7.3" 497 | resolved "https://registry.yarnpkg.com/sade/-/sade-1.7.3.tgz#a217ccc4fb4abb2d271648bf48f6628b2636fa1b" 498 | integrity sha512-m4BctppMvJ60W1dXnHq7jMmFe3hPJZDAH85kQ3ACTo7XZNVUuTItCQ+2HfyaMeV5cKrbw7l4vD/6We3GBxvdJw== 499 | dependencies: 500 | mri "^1.1.0" 501 | 502 | safe-buffer@^5.1.0: 503 | version "5.2.1" 504 | resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" 505 | integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== 506 | 507 | semiver@^1.0.0: 508 | version "1.1.0" 509 | resolved "https://registry.yarnpkg.com/semiver/-/semiver-1.1.0.tgz#9c97fb02c21c7ce4fcf1b73e2c7a24324bdddd5f" 510 | integrity sha512-QNI2ChmuioGC1/xjyYwyZYADILWyW6AmS1UH6gDj/SFUUUS4MBAWs/7mxnkRPc/F4iHezDP+O8t0dO8WHiEOdg== 511 | 512 | serialize-javascript@^4.0.0: 513 | version "4.0.0" 514 | resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-4.0.0.tgz#b525e1238489a5ecfc42afacc3fe99e666f4b1aa" 515 | integrity sha512-GaNA54380uFefWghODBWEGisLZFj00nS5ACs6yHa9nLqlLpVLO8ChDGeKRjZnV4Nh4n0Qi7nhYZD/9fCPzEqkw== 516 | dependencies: 517 | randombytes "^2.1.0" 518 | 519 | sirv-cli@^1.0.0: 520 | version "1.0.6" 521 | resolved "https://registry.yarnpkg.com/sirv-cli/-/sirv-cli-1.0.6.tgz#a4924254d965b23a518512f70010e710185de2f1" 522 | integrity sha512-K/iY1OHG7hTw4GzLoqMhwzKCbgWmx5joYAAF2+CwyiamWCpVzAgNVWgAc0JmSA2Gf3wseov05il2QbFTGTZMVg== 523 | dependencies: 524 | console-clear "^1.1.0" 525 | get-port "^3.2.0" 526 | kleur "^3.0.0" 527 | local-access "^1.0.1" 528 | sade "^1.6.0" 529 | semiver "^1.0.0" 530 | sirv "^1.0.6" 531 | tinydate "^1.0.0" 532 | 533 | sirv@^1.0.6: 534 | version "1.0.6" 535 | resolved "https://registry.yarnpkg.com/sirv/-/sirv-1.0.6.tgz#178c13bffccc0dea715a0e50894cf3a6c74a715e" 536 | integrity sha512-LRGu7Op4Xl9hhigOy2kcB53zAYTjNDdpooey49dIU0cMdpOv9ithVf7nstk3jvs8EhMiT/VORoyazZYGgw4vnA== 537 | dependencies: 538 | "@polka/url" "^1.0.0-next.9" 539 | mime "^2.3.1" 540 | totalist "^1.0.0" 541 | 542 | source-map-support@~0.5.12: 543 | version "0.5.19" 544 | resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.19.tgz#a98b62f86dcaf4f67399648c085291ab9e8fed61" 545 | integrity sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw== 546 | dependencies: 547 | buffer-from "^1.0.0" 548 | source-map "^0.6.0" 549 | 550 | source-map@^0.6.0, source-map@~0.6.1: 551 | version "0.6.1" 552 | resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" 553 | integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== 554 | 555 | sourcemap-codec@^1.4.4, sourcemap-codec@^1.4.8: 556 | version "1.4.8" 557 | resolved "https://registry.yarnpkg.com/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz#ea804bd94857402e6992d05a38ef1ae35a9ab4c4" 558 | integrity sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA== 559 | 560 | supports-color@^5.3.0: 561 | version "5.5.0" 562 | resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" 563 | integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== 564 | dependencies: 565 | has-flag "^3.0.0" 566 | 567 | supports-color@^7.0.0: 568 | version "7.2.0" 569 | resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" 570 | integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== 571 | dependencies: 572 | has-flag "^4.0.0" 573 | 574 | svelte-appwrite@../: 575 | version "0.1.0-beta" 576 | dependencies: 577 | appwrite "^2.0.0" 578 | 579 | svelte@^3.0.0: 580 | version "3.24.1" 581 | resolved "https://registry.yarnpkg.com/svelte/-/svelte-3.24.1.tgz#aca364937dd1df27fe131e2a4c234acb6061db4b" 582 | integrity sha512-OX/IBVUJSFo1rnznXdwf9rv6LReJ3qQ0PwRjj76vfUWyTfbHbR9OXqJBnUrpjyis2dwYcbT2Zm1DFjOOF1ZbbQ== 583 | 584 | terser@^5.0.0: 585 | version "5.3.0" 586 | resolved "https://registry.yarnpkg.com/terser/-/terser-5.3.0.tgz#c481f4afecdcc182d5e2bdd2ff2dc61555161e81" 587 | integrity sha512-XTT3D3AwxC54KywJijmY2mxZ8nJiEjBHVYzq8l9OaYuRFWeQNBwvipuzzYEP4e+/AVcd1hqG/CqgsdIRyT45Fg== 588 | dependencies: 589 | commander "^2.20.0" 590 | source-map "~0.6.1" 591 | source-map-support "~0.5.12" 592 | 593 | tinydate@^1.0.0: 594 | version "1.3.0" 595 | resolved "https://registry.yarnpkg.com/tinydate/-/tinydate-1.3.0.tgz#e6ca8e5a22b51bb4ea1c3a2a4fd1352dbd4c57fb" 596 | integrity sha512-7cR8rLy2QhYHpsBDBVYnnWXm8uRTr38RoZakFSW7Bs7PzfMPNZthuMLkwqZv7MTu8lhQ91cOFYS5a7iFj2oR3w== 597 | 598 | to-regex-range@^5.0.1: 599 | version "5.0.1" 600 | resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" 601 | integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== 602 | dependencies: 603 | is-number "^7.0.0" 604 | 605 | totalist@^1.0.0: 606 | version "1.1.0" 607 | resolved "https://registry.yarnpkg.com/totalist/-/totalist-1.1.0.tgz#a4d65a3e546517701e3e5c37a47a70ac97fe56df" 608 | integrity sha512-gduQwd1rOdDMGxFG1gEvhV88Oirdo2p+KjoYFU7k2g+i7n6AFFbDQ5kMPUsW0pNbfQsB/cwXvT1i4Bue0s9g5g== 609 | 610 | wrappy@1: 611 | version "1.0.2" 612 | resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" 613 | integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= 614 | 615 | ws@^6.2.1: 616 | version "6.2.1" 617 | resolved "https://registry.yarnpkg.com/ws/-/ws-6.2.1.tgz#442fdf0a47ed64f59b6a5d8ff130f4748ed524fb" 618 | integrity sha512-GIyAXC2cB7LjvpgMt9EKS2ldqr0MTrORaleiOno6TweZ6r3TKtoFQWay/2PceJ3RuBasOHzXNn5Lrw1X0bEjqA== 619 | dependencies: 620 | async-limiter "~1.0.0" 621 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "svelte-appwrite", 3 | "svelte": "src/index.js", 4 | "license": "BSD-3-Clause", 5 | "version": "0.3.0-beta", 6 | "scripts": { 7 | "lint": "eslint src/", 8 | "prettier": "prettier --write --plugin-search-dir= ./src/**/*.{js,svelte}", 9 | "typings": "sveld --markdown" 10 | }, 11 | "devDependencies": { 12 | "eslint": "^7.8.1", 13 | "eslint-plugin-svelte3": "^3.0.0", 14 | "husky": "^5.0.9", 15 | "npm-run-all": "^4.1.5", 16 | "prettier": "^2.1.1", 17 | "prettier-plugin-svelte": "^2.1.4", 18 | "sveld": "^0.7.0", 19 | "svelte": "^3.32.0" 20 | }, 21 | "keywords": [ 22 | "svelte" 23 | ], 24 | "files": [ 25 | "src", 26 | "types" 27 | ], 28 | "types": "./types/index.d.ts", 29 | "dependencies": { 30 | "appwrite": "^3.0.1" 31 | }, 32 | "husky": { 33 | "hooks": { 34 | "pre-commit": "run-s lint prettier" 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/Account/Create.svelte: -------------------------------------------------------------------------------- 1 | 30 | 31 | {#if $active} 32 | 33 | {/if} 34 | -------------------------------------------------------------------------------- /src/Account/Delete.svelte: -------------------------------------------------------------------------------- 1 | 27 | 28 | {#if $active} 29 | 30 | {/if} 31 | -------------------------------------------------------------------------------- /src/Account/Preferences.svelte: -------------------------------------------------------------------------------- 1 | 42 | 43 | {#if $active} 44 | {#await request} 45 | 46 | {:then prefs} 47 | 48 | {:catch error} 49 | 50 | {/await} 51 | {/if} 52 | -------------------------------------------------------------------------------- /src/Account/RecoverPassword.svelte: -------------------------------------------------------------------------------- 1 | 41 | 42 | {#if $active} 43 | 44 | {/if} 45 | -------------------------------------------------------------------------------- /src/Account/Update.svelte: -------------------------------------------------------------------------------- 1 | 55 | 56 | {#if $active} 57 | 58 | {/if} 59 | -------------------------------------------------------------------------------- /src/Account/User.svelte: -------------------------------------------------------------------------------- 1 | 79 | 80 | {#if $active} 81 | {#if $currentUser} 82 | 83 | {:else} 84 | {#await request} 85 | 86 | {:catch error} 87 | 88 | {/await} 89 | {/if} 90 | {/if} 91 | -------------------------------------------------------------------------------- /src/Account/Verification.svelte: -------------------------------------------------------------------------------- 1 | 41 | 42 | {#if $active} 43 | 44 | {/if} 45 | -------------------------------------------------------------------------------- /src/Auth/Email.svelte: -------------------------------------------------------------------------------- 1 | 33 | 34 | 35 | 36 | {#if request} 37 | {#await request()} 38 | 39 | {:then user} 40 | 41 | {:catch error} 42 | 43 | {/await} 44 | {/if} 45 | -------------------------------------------------------------------------------- /src/Auth/OAuth2.svelte: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/Avatars/Browser.svelte: -------------------------------------------------------------------------------- 1 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/Avatars/CreditCard.svelte: -------------------------------------------------------------------------------- 1 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/Avatars/Favicon.svelte: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/Avatars/Flag.svelte: -------------------------------------------------------------------------------- 1 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/Avatars/Image.svelte: -------------------------------------------------------------------------------- 1 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/Avatars/QR.svelte: -------------------------------------------------------------------------------- 1 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/Database/Collection.svelte: -------------------------------------------------------------------------------- 1 | 81 | 82 | {#await getDocuments} 83 | 84 | {:then current} 85 | 86 | {:catch error} 87 | 88 | {/await} 89 | -------------------------------------------------------------------------------- /src/Database/Document.svelte: -------------------------------------------------------------------------------- 1 | 84 | 85 | {#if id && collection} 86 | {#await document} 87 | 88 | {:then current} 89 | 90 | {:catch error} 91 | 92 | {/await} 93 | {:else} 94 | 95 | {/if} 96 | -------------------------------------------------------------------------------- /src/Functions/Function.svelte: -------------------------------------------------------------------------------- 1 | 37 | 38 | {#await executions} 39 | 40 | {:then current} 41 | 42 | {:catch error} 43 | 44 | {/await} 45 | -------------------------------------------------------------------------------- /src/Init.svelte: -------------------------------------------------------------------------------- 1 | 26 | 27 | {#if $active} 28 | 29 | {/if} 30 | -------------------------------------------------------------------------------- /src/Locale/Continents.svelte: -------------------------------------------------------------------------------- 1 | 20 | 21 | {#await continents} 22 | 23 | {:then response} 24 | 25 | {:catch error} 26 | 27 | {/await} 28 | -------------------------------------------------------------------------------- /src/Locale/Countries.svelte: -------------------------------------------------------------------------------- 1 | 24 | 25 | {#await countries} 26 | 27 | {:then response} 28 | 29 | {:catch error} 30 | 31 | {/await} 32 | -------------------------------------------------------------------------------- /src/Locale/Currencies.svelte: -------------------------------------------------------------------------------- 1 | 20 | 21 | {#await currencies} 22 | 23 | {:then response} 24 | 25 | {:catch error} 26 | 27 | {/await} 28 | -------------------------------------------------------------------------------- /src/Locale/Languages.svelte: -------------------------------------------------------------------------------- 1 | 20 | 21 | {#await languages} 22 | 23 | {:then response} 24 | 25 | {:catch error} 26 | 27 | {/await} 28 | -------------------------------------------------------------------------------- /src/Locale/Locale.svelte: -------------------------------------------------------------------------------- 1 | 20 | 21 | {#await locale} 22 | 23 | {:then response} 24 | 25 | {:catch error} 26 | 27 | {/await} 28 | -------------------------------------------------------------------------------- /src/Locale/PhoneCodes.svelte: -------------------------------------------------------------------------------- 1 | 20 | 21 | {#await phoneCodes} 22 | 23 | {:then response} 24 | 25 | {:catch error} 26 | 27 | {/await} 28 | -------------------------------------------------------------------------------- /src/Storage/File.svelte: -------------------------------------------------------------------------------- 1 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /src/Storage/FileList.svelte: -------------------------------------------------------------------------------- 1 | 24 | 25 | {#await files} 26 | 27 | {:then response} 28 | 29 | {:catch error} 30 | 31 | {/await} 32 | -------------------------------------------------------------------------------- /src/Storage/Storage.svelte: -------------------------------------------------------------------------------- 1 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /src/appwrite.js: -------------------------------------------------------------------------------- 1 | import { Appwrite } from "appwrite"; 2 | 3 | export const SDK = { 4 | sdk: new Appwrite(), 5 | setConfig: config => { 6 | SDK.sdk 7 | .setEndpoint(config.endpoint) 8 | .setProject(config.project) 9 | .setLocale(config.locale); 10 | }, 11 | }; 12 | -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | export { default as Appwrite } from "./Init.svelte"; 2 | export { SDK } from "./appwrite"; 3 | 4 | export { default as User } from "./Account/User.svelte"; 5 | export { default as Create } from "./Account/Create.svelte"; 6 | export { default as Delete } from "./Account/Delete.svelte"; 7 | export { default as Preferences } from "./Account/Preferences.svelte"; 8 | export { default as RecoverPassword } from "./Account/RecoverPassword.svelte"; 9 | export { default as Update } from "./Account/Update.svelte"; 10 | export { default as Verification } from "./Account/Verification.svelte"; 11 | 12 | export { default as AuthEmail } from "./Auth/Email.svelte"; 13 | export { default as AuthOAuth2 } from "./Auth/OAuth2.svelte"; 14 | 15 | export { default as Collection } from "./Database/Collection.svelte"; 16 | export { default as Document } from "./Database/Document.svelte"; 17 | 18 | export { default as Storage } from "./Storage/Storage.svelte"; 19 | export { default as FileList } from "./Storage/FileList.svelte"; 20 | export { default as File } from "./Storage/File.svelte"; 21 | 22 | export { default as Locale } from "./Locale/Locale.svelte"; 23 | export { default as Countries } from "./Locale/Countries.svelte"; 24 | export { default as Continents } from "./Locale/Continents.svelte"; 25 | export { default as Languages } from "./Locale/Languages.svelte"; 26 | 27 | export { default as Flag } from "./Avatars/Flag.svelte"; 28 | export { default as Browser } from "./Avatars/Browser.svelte"; 29 | export { default as CreditCard } from "./Avatars/CreditCard.svelte"; 30 | export { default as Favicon } from "./Avatars/Favicon.svelte"; 31 | export { default as Image } from "./Avatars/Image.svelte"; 32 | export { default as QR } from "./Avatars/QR.svelte"; 33 | 34 | export { default as Function } from "./Functions/Function.svelte"; -------------------------------------------------------------------------------- /src/keys.js: -------------------------------------------------------------------------------- 1 | export const cacheKey = {}; -------------------------------------------------------------------------------- /src/stores.js: -------------------------------------------------------------------------------- 1 | import { writable } from "svelte/store"; 2 | import { UserStore } from "./stores/user"; 3 | import { DocumentsStore } from "./stores/documents"; 4 | 5 | export const active = writable(false); 6 | export const currentUser = new UserStore(); 7 | export const documents = new DocumentsStore(); 8 | -------------------------------------------------------------------------------- /src/stores/documents.js: -------------------------------------------------------------------------------- 1 | import { SDK as Appwrite } from "../appwrite"; 2 | import { writable, get } from "svelte/store"; 3 | 4 | export class DocumentsStore { 5 | constructor() { 6 | const { subscribe, set, update } = writable(new Map()); 7 | this.subscribe = subscribe; 8 | this.set = set; 9 | this.update = update; 10 | } 11 | 12 | clear() { 13 | this.set(new Map()); 14 | } 15 | 16 | /** 17 | * Get Documents in a Collection 18 | * @param {string} id Collection Id 19 | * @param {boolean} cache Use cached response 20 | * @param {{ filters: string[], limit: number, offset: number, orderField: string, orderType: string, orderCast: string, search: string }} query Query paramters 21 | * @returns {Promise<{documents: any[], sum: number}>} 22 | */ 23 | async fetchDocuments(id, cache, query) { 24 | if (cache) { 25 | const docs = Array.from(get(this).entries()) 26 | .filter(entry => entry[0].startsWith(id)) 27 | .map(entry => entry[1]); 28 | 29 | if (docs?.length) { 30 | return { 31 | documents: docs, 32 | sum: docs.length, 33 | }; 34 | } 35 | } 36 | 37 | const response = await Appwrite.sdk.database.listDocuments( 38 | id, 39 | query.filters, 40 | query.limit, 41 | query.offset, 42 | query.orderField, 43 | query.orderType, 44 | query.orderCast, 45 | query.search 46 | ); 47 | 48 | if (cache) { 49 | this.update(docs => { 50 | for (const document of response.documents) { 51 | docs.set(`${id}:${document.$id}`, document); 52 | } 53 | return docs; 54 | }); 55 | } 56 | return response; 57 | } 58 | 59 | /** 60 | * @param {string} collection Collection ID 61 | * @param {string} id Document ID 62 | * @param {boolean} cache Use cache 63 | * @returns {Promise} 64 | */ 65 | async fetchDocument(collection, id, cache) { 66 | const key = `${collection}:${id}`; 67 | if (cache) { 68 | const docs = get(this); 69 | if (docs.has(key)) return docs.get(key); 70 | } 71 | 72 | const response = await Appwrite.sdk.database.getDocument(collection, id); 73 | 74 | if (cache) { 75 | this.update(docs => { 76 | docs.set(key, response); 77 | return docs; 78 | }); 79 | } 80 | 81 | return response; 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /src/stores/user.js: -------------------------------------------------------------------------------- 1 | import { SDK as Appwrite } from "../appwrite"; 2 | import { writable } from "svelte/store"; 3 | 4 | export class UserStore { 5 | constructor() { 6 | const { subscribe, set, update } = writable(null); 7 | this.subscribe = subscribe; 8 | this.set = set; 9 | this.update = update; 10 | } 11 | 12 | /** 13 | * Reload the current User. 14 | * @returns {object} 15 | */ 16 | async reload() { 17 | const response = await Appwrite.sdk.account.get(); 18 | this.set(response); 19 | return response; 20 | } 21 | 22 | /** 23 | * Logout the current User. 24 | * @returns {object} 25 | */ 26 | async logout() { 27 | const response = await Appwrite.sdk.account.deleteSession("current"); 28 | this.set(null); 29 | return response; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /types/Account/Create.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { SvelteComponentTyped } from "svelte"; 3 | 4 | export interface CreateProps {} 5 | 6 | export default class Create extends SvelteComponentTyped< 7 | CreateProps, 8 | { success: CustomEvent; failure: CustomEvent }, 9 | { 10 | default: { 11 | actions: { 12 | create: ( 13 | email: string, 14 | password: string, 15 | name?: string 16 | ) => Promise; 17 | }; 18 | }; 19 | } 20 | > {} 21 | -------------------------------------------------------------------------------- /types/Account/Delete.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { SvelteComponentTyped } from "svelte"; 3 | 4 | export interface DeleteProps {} 5 | 6 | export default class Delete extends SvelteComponentTyped< 7 | DeleteProps, 8 | {}, 9 | { 10 | default: { 11 | actions: { 12 | delete: () => Promise; 13 | }; 14 | }; 15 | } 16 | > {} 17 | -------------------------------------------------------------------------------- /types/Account/Preferences.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { SvelteComponentTyped } from "svelte"; 3 | 4 | export interface PreferencesProps {} 5 | 6 | export default class Preferences extends SvelteComponentTyped< 7 | PreferencesProps, 8 | {}, 9 | { 10 | default: { 11 | actions: { 12 | reload: () => Promise; 13 | update: (prefs: object) => Promise; 14 | }; 15 | }; 16 | error: { error: object }; 17 | loading: {}; 18 | } 19 | > {} 20 | -------------------------------------------------------------------------------- /types/Account/RecoverPassword.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { SvelteComponentTyped } from "svelte"; 3 | 4 | export interface RecoverPasswordProps {} 5 | 6 | export default class RecoverPassword extends SvelteComponentTyped< 7 | RecoverPasswordProps, 8 | {}, 9 | { 10 | default: { 11 | actions: { 12 | recover: (email: string, url: string) => Promise; 13 | complete: ( 14 | user: string, 15 | secret: string, 16 | password: string, 17 | passwordAgain: string 18 | ) => Promise; 19 | }; 20 | }; 21 | } 22 | > {} 23 | -------------------------------------------------------------------------------- /types/Account/Update.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { SvelteComponentTyped } from "svelte"; 3 | 4 | export interface UpdateProps {} 5 | 6 | export default class Update extends SvelteComponentTyped< 7 | UpdateProps, 8 | {}, 9 | { 10 | default: { 11 | actions: { 12 | name: (name: string) => Promise; 13 | email: (email: string, password: string) => Promise; 14 | password: (password: string, oldPassword: string) => Promise; 15 | }; 16 | }; 17 | } 18 | > {} 19 | -------------------------------------------------------------------------------- /types/Account/User.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { SvelteComponentTyped } from "svelte"; 3 | 4 | export interface AppwriteUser { 5 | $id: string; 6 | email: string; 7 | emailVerification: boolean; 8 | name: string; 9 | registration: number; 10 | status: number; 11 | prefs: object; 12 | } 13 | 14 | export interface UserProps {} 15 | 16 | export default class User extends SvelteComponentTyped< 17 | UserProps, 18 | { 19 | success: CustomEvent; 20 | failure: CustomEvent; 21 | successLogout: CustomEvent; 22 | failureLogout: CustomEvent; 23 | successLogoutFrom: CustomEvent; 24 | failureLogoutFrom: CustomEvent; 25 | successLogoutAll: CustomEvent; 26 | failureLogoutAll: CustomEvent; 27 | }, 28 | { 29 | default: { 30 | user: AppwriteUser; 31 | actions: { 32 | reload: () => void; 33 | logout: () => Promise; 34 | logoutFrom: (session: string) => Promise; 35 | logoutAll: () => Promise; 36 | }; 37 | }; 38 | error: { error: object }; 39 | loading: {}; 40 | } 41 | > {} 42 | -------------------------------------------------------------------------------- /types/Account/Verification.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { SvelteComponentTyped } from "svelte"; 3 | 4 | export interface VerificationProps {} 5 | 6 | export default class Verification extends SvelteComponentTyped< 7 | VerificationProps, 8 | {}, 9 | { 10 | default: { 11 | actions: { 12 | create: (url: string) => Promise; 13 | complete: (user: string, secret: string) => Promise; 14 | }; 15 | }; 16 | } 17 | > {} 18 | -------------------------------------------------------------------------------- /types/Auth/Email.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { SvelteComponentTyped } from "svelte"; 3 | 4 | export interface AuthEmailProps {} 5 | 6 | export default class AuthEmail extends SvelteComponentTyped< 7 | AuthEmailProps, 8 | { success: CustomEvent; failure: CustomEvent }, 9 | { 10 | default: { 11 | authorize: (email: string, password: string) => Promise; 12 | }; 13 | error: { error: object }; 14 | loading: {}; 15 | success: { user: any }; 16 | } 17 | > {} 18 | -------------------------------------------------------------------------------- /types/Auth/OAuth2.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { SvelteComponentTyped } from "svelte"; 3 | 4 | export interface AuthOAuth2Props { 5 | provider?: undefined; 6 | 7 | success?: undefined; 8 | 9 | failure?: undefined; 10 | } 11 | 12 | export default class AuthOAuth2 extends SvelteComponentTyped< 13 | AuthOAuth2Props, 14 | {}, 15 | { 16 | default: { 17 | authorize: ( 18 | provider: string, 19 | success: string, 20 | failure: string 21 | ) => Promise; 22 | }; 23 | } 24 | > {} 25 | -------------------------------------------------------------------------------- /types/Avatars/Browser.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { SvelteComponentTyped } from "svelte"; 3 | 4 | export interface BrowserProps { 5 | code?: undefined; 6 | 7 | /** 8 | * @default 100 9 | */ 10 | width?: number; 11 | 12 | /** 13 | * @default 100 14 | */ 15 | height?: number; 16 | 17 | /** 18 | * @default 100 19 | */ 20 | quality?: number; 21 | } 22 | 23 | export default class Browser extends SvelteComponentTyped< 24 | BrowserProps, 25 | {}, 26 | { default: { src: any } } 27 | > {} 28 | -------------------------------------------------------------------------------- /types/Avatars/CreditCard.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { SvelteComponentTyped } from "svelte"; 3 | 4 | export interface CreditCardProps { 5 | code?: undefined; 6 | 7 | /** 8 | * @default 100 9 | */ 10 | width?: number; 11 | 12 | /** 13 | * @default 100 14 | */ 15 | height?: number; 16 | 17 | /** 18 | * @default 100 19 | */ 20 | quality?: number; 21 | } 22 | 23 | export default class CreditCard extends SvelteComponentTyped< 24 | CreditCardProps, 25 | {}, 26 | { default: { src: any } } 27 | > {} 28 | -------------------------------------------------------------------------------- /types/Avatars/Favicon.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { SvelteComponentTyped } from "svelte"; 3 | 4 | export interface FaviconProps { 5 | url?: undefined; 6 | } 7 | 8 | export default class Favicon extends SvelteComponentTyped< 9 | FaviconProps, 10 | {}, 11 | { default: { src: any } } 12 | > {} 13 | -------------------------------------------------------------------------------- /types/Avatars/Flag.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { SvelteComponentTyped } from "svelte"; 3 | 4 | export interface FlagProps { 5 | code?: undefined; 6 | 7 | /** 8 | * @default 100 9 | */ 10 | width?: number; 11 | 12 | /** 13 | * @default 100 14 | */ 15 | height?: number; 16 | 17 | /** 18 | * @default 100 19 | */ 20 | quality?: number; 21 | } 22 | 23 | export default class Flag extends SvelteComponentTyped< 24 | FlagProps, 25 | {}, 26 | { default: { src: any } } 27 | > {} 28 | -------------------------------------------------------------------------------- /types/Avatars/Image.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { SvelteComponentTyped } from "svelte"; 3 | 4 | export interface ImageProps { 5 | url?: undefined; 6 | 7 | /** 8 | * @default "" 9 | */ 10 | width?: string; 11 | 12 | /** 13 | * @default "" 14 | */ 15 | height?: string; 16 | } 17 | 18 | export default class Image extends SvelteComponentTyped< 19 | ImageProps, 20 | {}, 21 | { default: { src: any } } 22 | > {} 23 | -------------------------------------------------------------------------------- /types/Avatars/QR.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { SvelteComponentTyped } from "svelte"; 3 | 4 | export interface QRProps { 5 | text?: undefined; 6 | 7 | /** 8 | * @default 400 9 | */ 10 | size?: number; 11 | 12 | /** 13 | * @default 1 14 | */ 15 | margin?: number; 16 | 17 | /** 18 | * @default false 19 | */ 20 | download?: boolean; 21 | } 22 | 23 | export default class QR extends SvelteComponentTyped< 24 | QRProps, 25 | {}, 26 | { default: { src: any } } 27 | > {} 28 | -------------------------------------------------------------------------------- /types/Database/Collection.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { SvelteComponentTyped } from "svelte"; 3 | 4 | export interface CollectionProps { 5 | id?: string; 6 | 7 | /** 8 | * @default [] 9 | */ 10 | filters?: string[]; 11 | 12 | /** 13 | * @default 0 14 | */ 15 | offset?: number; 16 | 17 | /** 18 | * @default 25 19 | */ 20 | limit?: number; 21 | 22 | /** 23 | * @default "" 24 | */ 25 | orderField?: string; 26 | 27 | /** 28 | * @default "" 29 | */ 30 | orderType?: string; 31 | 32 | /** 33 | * @default "string" 34 | */ 35 | orderCast?: string; 36 | 37 | /** 38 | * @default "" 39 | */ 40 | search?: string; 41 | 42 | /** 43 | * @default false 44 | */ 45 | cache?: boolean; 46 | } 47 | 48 | export default class Collection extends SvelteComponentTyped< 49 | CollectionProps, 50 | {}, 51 | { 52 | default: { 53 | documents: any[]; 54 | actions: { 55 | reload: () => Promise; 56 | create: ( 57 | data: any, 58 | read?: string[], 59 | write?: string[] 60 | ) => Promise; 61 | }; 62 | }; 63 | error: { error: object }; 64 | loading: {}; 65 | } 66 | > {} 67 | -------------------------------------------------------------------------------- /types/Database/Document.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { SvelteComponentTyped } from "svelte"; 3 | 4 | export interface DocumentProps { 5 | id?: string; 6 | 7 | collection?: string; 8 | 9 | document?: any; 10 | 11 | cache?: boolean; 12 | } 13 | 14 | export default class Document extends SvelteComponentTyped< 15 | DocumentProps, 16 | { change: CustomEvent }, 17 | { 18 | default: { 19 | document: any; 20 | actions: { 21 | reload: () => Promise; 22 | update: (data: any) => Promise; 23 | remove: () => Promise; 24 | }; 25 | }; 26 | error: { error: any }; 27 | loading: {}; 28 | } 29 | > {} 30 | -------------------------------------------------------------------------------- /types/Functions/Function.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { SvelteComponentTyped } from "svelte"; 3 | 4 | export interface FunctionProps { 5 | id?: undefined; 6 | 7 | /** 8 | * @default "" 9 | */ 10 | search?: string; 11 | 12 | /** 13 | * @default 25 14 | */ 15 | limit?: number; 16 | 17 | /** 18 | * @default 0 19 | */ 20 | offset?: number; 21 | 22 | /** 23 | * @default "" 24 | */ 25 | orderType?: string; 26 | } 27 | 28 | export default class Function extends SvelteComponentTyped< 29 | FunctionProps, 30 | {}, 31 | { 32 | default: { 33 | executions: any; 34 | actions: { 35 | reload: () => Promise; 36 | create: () => Promise; 37 | get: (execution: string) => Promise; 38 | }; 39 | }; 40 | error: { error: object }; 41 | loading: {}; 42 | } 43 | > {} 44 | -------------------------------------------------------------------------------- /types/Init.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { SvelteComponentTyped } from "svelte"; 3 | 4 | export interface AppwriteProps { 5 | endpoint?: string; 6 | 7 | project?: string; 8 | 9 | /** 10 | * @default "en" 11 | */ 12 | locale?: string; 13 | } 14 | 15 | export default class Appwrite extends SvelteComponentTyped< 16 | AppwriteProps, 17 | {}, 18 | { default: {} } 19 | > {} 20 | -------------------------------------------------------------------------------- /types/Locale/Continents.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { SvelteComponentTyped } from "svelte"; 3 | 4 | export interface ContinentsProps {} 5 | 6 | export default class Continents extends SvelteComponentTyped< 7 | ContinentsProps, 8 | {}, 9 | { 10 | default: { 11 | continents: any; 12 | actions: { 13 | reload: () => Promise; 14 | }; 15 | }; 16 | error: { error: object }; 17 | loading: {}; 18 | } 19 | > {} 20 | -------------------------------------------------------------------------------- /types/Locale/Countries.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { SvelteComponentTyped } from "svelte"; 3 | 4 | export interface CountriesProps { 5 | /** 6 | * @default false 7 | */ 8 | eu?: boolean; 9 | } 10 | 11 | export default class Countries extends SvelteComponentTyped< 12 | CountriesProps, 13 | {}, 14 | { 15 | default: { 16 | countries: any; 17 | actions: { 18 | reload: () => Promise; 19 | }; 20 | }; 21 | error: { error: object }; 22 | loading: {}; 23 | } 24 | > {} 25 | -------------------------------------------------------------------------------- /types/Locale/Languages.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { SvelteComponentTyped } from "svelte"; 3 | 4 | export interface LanguagesProps {} 5 | 6 | export default class Languages extends SvelteComponentTyped< 7 | LanguagesProps, 8 | {}, 9 | { 10 | default: { 11 | languages: any; 12 | actions: { 13 | reload: () => Promise; 14 | }; 15 | }; 16 | error: { error: object }; 17 | loading: {}; 18 | } 19 | > {} 20 | -------------------------------------------------------------------------------- /types/Locale/Locale.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { SvelteComponentTyped } from "svelte"; 3 | 4 | export interface LocaleProps {} 5 | 6 | export default class Locale extends SvelteComponentTyped< 7 | LocaleProps, 8 | {}, 9 | { 10 | default: { 11 | code: any; 12 | actions: { 13 | reload: () => Promise; 14 | }; 15 | }; 16 | error: { error: object }; 17 | loading: {}; 18 | } 19 | > {} 20 | -------------------------------------------------------------------------------- /types/Storage/File.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { SvelteComponentTyped } from "svelte"; 3 | 4 | export interface FileProps { 5 | file?: undefined; 6 | } 7 | 8 | export default class File extends SvelteComponentTyped< 9 | FileProps, 10 | {}, 11 | { 12 | default: { 13 | file: any; 14 | actions: { 15 | download: () => string; 16 | view: (as?: string) => string; 17 | preview: ( 18 | width?: string, 19 | height?: string, 20 | quality?: string, 21 | background?: string, 22 | output?: string 23 | ) => string; 24 | update: (read?: any, write?: any) => Promise; 25 | delete: () => Promise; 26 | }; 27 | }; 28 | error: { error: object }; 29 | } 30 | > {} 31 | -------------------------------------------------------------------------------- /types/Storage/FileList.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { SvelteComponentTyped } from "svelte"; 3 | 4 | export interface FileListProps { 5 | /** 6 | * @default "" 7 | */ 8 | search?: string; 9 | 10 | /** 11 | * @default 25 12 | */ 13 | limit?: number; 14 | 15 | /** 16 | * @default 0 17 | */ 18 | offset?: number; 19 | 20 | /** 21 | * @default "ASC" 22 | */ 23 | orderType?: string; 24 | } 25 | 26 | export default class FileList extends SvelteComponentTyped< 27 | FileListProps, 28 | {}, 29 | { 30 | default: { 31 | files: any[]; 32 | actions: { 33 | reload: () => Promise; 34 | }; 35 | }; 36 | error: { error: object }; 37 | loading: {}; 38 | } 39 | > {} 40 | -------------------------------------------------------------------------------- /types/Storage/Storage.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { SvelteComponentTyped } from "svelte"; 3 | 4 | export interface StorageProps {} 5 | 6 | export default class Storage extends SvelteComponentTyped< 7 | StorageProps, 8 | { 9 | upload: CustomEvent; 10 | success: CustomEvent; 11 | failure: CustomEvent; 12 | }, 13 | { 14 | default: { 15 | actions: { 16 | create: ( 17 | file: any, 18 | read?: string[], 19 | write?: string[] 20 | ) => Promise; 21 | }; 22 | }; 23 | error: { error: object }; 24 | } 25 | > {} 26 | -------------------------------------------------------------------------------- /types/index.d.ts: -------------------------------------------------------------------------------- 1 | export { default as Appwrite } from "./Init"; 2 | export { default as SDK } from "./appwrite"; 3 | export { default as User } from "./Account/User"; 4 | export { default as Create } from "./Account/Create"; 5 | export { default as Delete } from "./Account/Delete"; 6 | export { default as Preferences } from "./Account/Preferences"; 7 | export { default as RecoverPassword } from "./Account/RecoverPassword"; 8 | export { default as Update } from "./Account/Update"; 9 | export { default as Verification } from "./Account/Verification"; 10 | export { default as AuthEmail } from "./Auth/Email"; 11 | export { default as AuthOAuth2 } from "./Auth/OAuth2"; 12 | export { default as Collection } from "./Database/Collection"; 13 | export { default as Document } from "./Database/Document"; 14 | export { default as Storage } from "./Storage/Storage"; 15 | export { default as FileList } from "./Storage/FileList"; 16 | export { default as File } from "./Storage/File"; 17 | export { default as Locale } from "./Locale/Locale"; 18 | export { default as Countries } from "./Locale/Countries"; 19 | export { default as Continents } from "./Locale/Continents"; 20 | export { default as Languages } from "./Locale/Languages"; 21 | export { default as Flag } from "./Avatars/Flag"; 22 | export { default as Browser } from "./Avatars/Browser"; 23 | export { default as CreditCard } from "./Avatars/CreditCard"; 24 | export { default as Favicon } from "./Avatars/Favicon"; 25 | export { default as Image } from "./Avatars/Image"; 26 | export { default as QR } from "./Avatars/QR"; 27 | export { default as Function } from "./Functions/Function"; 28 | --------------------------------------------------------------------------------